diff options
author | 2017-09-22 16:13:04 -0700 | |
---|---|---|
committer | 2017-09-22 16:13:04 -0700 | |
commit | 387ceb480bf6303cdc3d2677c07e44204ea47419 (patch) | |
tree | 47400ceaece2077ce724da910846d61c68b90825 /plugin | |
parent | 6f19dda0b452c1c51329ec7829b8af7cdf30e34e (diff) | |
download | coredns-387ceb480bf6303cdc3d2677c07e44204ea47419.tar.gz coredns-387ceb480bf6303cdc3d2677c07e44204ea47419.tar.zst coredns-387ceb480bf6303cdc3d2677c07e44204ea47419.zip |
go lint/vet/misspell cleanup (#1105)
This fix address several issues related to golint/vet/misspell.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/dnstap/out/socket.go | 6 | ||||
-rw-r--r-- | plugin/dnstap/out/tcp_test.go | 6 | ||||
-rw-r--r-- | plugin/file/file.go | 2 | ||||
-rw-r--r-- | plugin/pkg/dnstest/recorder.go | 2 | ||||
-rw-r--r-- | plugin/rewrite/rewrite.go | 2 |
5 files changed, 6 insertions, 12 deletions
diff --git a/plugin/dnstap/out/socket.go b/plugin/dnstap/out/socket.go index 520dcf1d8..58285f25c 100644 --- a/plugin/dnstap/out/socket.go +++ b/plugin/dnstap/out/socket.go @@ -78,9 +78,5 @@ func (s *Socket) Close() error { if err := s.enc.Flush(); err != nil { return fmt.Errorf("flush: %s", err) } - if err := s.enc.Close(); err != nil { - return err - } - - return nil + return s.enc.Close() } diff --git a/plugin/dnstap/out/tcp_test.go b/plugin/dnstap/out/tcp_test.go index 113603cd4..45ac98bf7 100644 --- a/plugin/dnstap/out/tcp_test.go +++ b/plugin/dnstap/out/tcp_test.go @@ -9,11 +9,9 @@ func sendOneTCP(tcp *TCP) error { if _, err := tcp.Write([]byte("frame")); err != nil { return err } - if err := tcp.Flush(); err != nil { - return err - } - return nil + return tcp.Flush() } + func TestTCP(t *testing.T) { tcp := NewTCP("localhost:14000") diff --git a/plugin/file/file.go b/plugin/file/file.go index 3f6ae8acf..6fb2e42fb 100644 --- a/plugin/file/file.go +++ b/plugin/file/file.go @@ -113,7 +113,7 @@ type serialErr struct { } func (s *serialErr) Error() string { - return fmt.Sprintf("%s for origin %s in file %s, with serial %d", s.err, s.zone, s.serial) + return fmt.Sprintf("%s for origin %s in file %s, with serial %d", s.err, s.origin, s.zone, s.serial) } // Parse parses the zone in filename and returns a new Zone or an error. diff --git a/plugin/pkg/dnstest/recorder.go b/plugin/pkg/dnstest/recorder.go index 1de68f8fc..1da063e14 100644 --- a/plugin/pkg/dnstest/recorder.go +++ b/plugin/pkg/dnstest/recorder.go @@ -21,7 +21,7 @@ type Recorder struct { Start time.Time } -// New makes and returns a new Recorder, +// NewRecorder makes and returns a new Recorder, // which captures the DNS rcode from the ResponseWriter // and also the length of the response message written through it. func NewRecorder(w dns.ResponseWriter) *Recorder { diff --git a/plugin/rewrite/rewrite.go b/plugin/rewrite/rewrite.go index 384d1718d..0a0bb831c 100644 --- a/plugin/rewrite/rewrite.go +++ b/plugin/rewrite/rewrite.go @@ -94,7 +94,7 @@ func newRule(args ...string) (Rule, error) { expectNumArgs = len(args) - 1 startArg = 2 default: - // for backward compability + // for backward compatibility ruleType = arg0 expectNumArgs = len(args) startArg = 1 |