mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 10:13:14 -05:00
Run golint and go vet (#276)
Cleanup the errors and removed deadcode along the way. The leaves some error laying around, mostly about commenting exported identifier. We should look hard if those really are needed.
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
// ToString convert the rcode to the offical DNS string, or to "RCODE"+value if the RCODE
|
||||
// value is unknown.
|
||||
func ToString(rcode int) string {
|
||||
if str, ok := dns.RcodeToString[rcode]; ok {
|
||||
return str
|
||||
|
||||
@@ -2,14 +2,20 @@ package response
|
||||
|
||||
import "github.com/miekg/dns"
|
||||
|
||||
// Type is the type of the message
|
||||
type Type int
|
||||
|
||||
const (
|
||||
Success Type = iota
|
||||
NameError // NXDOMAIN in header, SOA in auth.
|
||||
NoData // NOERROR in header, SOA in auth.
|
||||
Delegation // NOERROR in header, NS in auth, optionally fluff in additional (not checked).
|
||||
OtherError // Don't cache these.
|
||||
// Success indicates a positive reply
|
||||
Success Type = iota
|
||||
// NameError is a NXDOMAIN in header, SOA in auth.
|
||||
NameError
|
||||
// NoData indicated name found, but not the type: NOERROR in header, SOA in auth.
|
||||
NoData
|
||||
// Delegation is a msg with a pointer to another nameserver: NOERROR in header, NS in auth, optionally fluff in additional (not checked).
|
||||
Delegation
|
||||
// OtherError indicated any other error: don't cache these.
|
||||
OtherError
|
||||
)
|
||||
|
||||
// Classify classifies a message, it returns the Type.
|
||||
|
||||
@@ -25,7 +25,7 @@ type dir http.Dir
|
||||
//
|
||||
// CoreDir will default to "$HOME/.coredns" on Unix, but it's location can be overriden with the COREDNSPATH
|
||||
// environment variable.
|
||||
var CoreDir dir = dir(fsPath())
|
||||
var CoreDir = dir(fsPath())
|
||||
|
||||
func (d dir) Zone(z string) dir {
|
||||
if z != "." && z[len(z)-2] == '.' {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestfsPath(t *testing.T) {
|
||||
func TestFsPath(t *testing.T) {
|
||||
if actual := fsPath(); !strings.HasSuffix(actual, ".coredns") {
|
||||
t.Errorf("Expected path to be a .coredns folder, got: %v", actual)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user