mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
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>
This commit is contained in:
@@ -78,9 +78,5 @@ func (s *Socket) Close() error {
|
|||||||
if err := s.enc.Flush(); err != nil {
|
if err := s.enc.Flush(); err != nil {
|
||||||
return fmt.Errorf("flush: %s", err)
|
return fmt.Errorf("flush: %s", err)
|
||||||
}
|
}
|
||||||
if err := s.enc.Close(); err != nil {
|
return s.enc.Close()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,9 @@ func sendOneTCP(tcp *TCP) error {
|
|||||||
if _, err := tcp.Write([]byte("frame")); err != nil {
|
if _, err := tcp.Write([]byte("frame")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := tcp.Flush(); err != nil {
|
return tcp.Flush()
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTCP(t *testing.T) {
|
func TestTCP(t *testing.T) {
|
||||||
tcp := NewTCP("localhost:14000")
|
tcp := NewTCP("localhost:14000")
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ type serialErr struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *serialErr) Error() string {
|
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.
|
// Parse parses the zone in filename and returns a new Zone or an error.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ type Recorder struct {
|
|||||||
Start time.Time
|
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
|
// which captures the DNS rcode from the ResponseWriter
|
||||||
// and also the length of the response message written through it.
|
// and also the length of the response message written through it.
|
||||||
func NewRecorder(w dns.ResponseWriter) *Recorder {
|
func NewRecorder(w dns.ResponseWriter) *Recorder {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ func newRule(args ...string) (Rule, error) {
|
|||||||
expectNumArgs = len(args) - 1
|
expectNumArgs = len(args) - 1
|
||||||
startArg = 2
|
startArg = 2
|
||||||
default:
|
default:
|
||||||
// for backward compability
|
// for backward compatibility
|
||||||
ruleType = arg0
|
ruleType = arg0
|
||||||
expectNumArgs = len(args)
|
expectNumArgs = len(args)
|
||||||
startArg = 1
|
startArg = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user