From eef5559a43711e001e2c0cfebdd3462029971617 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Fri, 17 Apr 2015 11:11:52 +0000 Subject: [PATCH 1/3] Lint the codebase in travis. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 56eb4711..1cc66109 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,13 @@ addons: packages: - libpcap-dev -install: +install: - go clean -i net - go install -tags netgo std - make travis script: + - bin/lint . - make tests after_success: From c187c9b290512d4e4daa825563b1df9b020f8b3d Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Fri, 17 Apr 2015 11:37:36 +0000 Subject: [PATCH 2/3] Make lint script work; $result has special meaning! --- bin/lint | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/lint b/bin/lint index 9f5d3c89..78b9f6a5 100755 --- a/bin/lint +++ b/bin/lint @@ -63,11 +63,11 @@ function lint { } function lint_files { - result=0 + lint_result=0 while read filename; do - lint "${filename}" || result=1 + lint "${filename}" || lint_result=1 done - exit $result + exit $lint_result } function list_files { From f735082d9501bbb78d8a60e716813ccba76f9e8a Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Fri, 17 Apr 2015 11:39:39 +0000 Subject: [PATCH 3/3] Fix gofmt errors in nameserver. --- nameserver/cache.go | 2 +- nameserver/server.go | 4 ++-- weavedns/main.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nameserver/cache.go b/nameserver/cache.go index 107dbe22..137f048a 100644 --- a/nameserver/cache.go +++ b/nameserver/cache.go @@ -22,7 +22,7 @@ const ( defPendingTimeout int = 5 // timeout for a resolution ) -const nullTTL = 0 // a null TTL +const nullTTL = 0 // a null TTL type entryStatus uint8 diff --git a/nameserver/server.go b/nameserver/server.go index 3b7e4d8c..9c80670c 100644 --- a/nameserver/server.go +++ b/nameserver/server.go @@ -278,7 +278,7 @@ func (s *DNSServer) rdnsHandler(proto dnsProtocol) dns.HandlerFunc { lookups := []Lookup{s.Zone, s.mdnsCli} maxLen := getMaxReplyLen(r, proto) - Debug.Printf("Reverse query: %+v", q) + Debug.Printf("Reverse query: %+v", q) reply, err := s.cache.Get(r, maxLen, time.Now()) if err != nil { if err == errNoLocalReplies { @@ -300,7 +300,7 @@ func (s *DNSServer) rdnsHandler(proto dnsProtocol) dns.HandlerFunc { // catch unsupported queries if q.Qtype != dns.TypePTR { Warning.Printf("[dns msgid %d] Unexpected reverse query type %s: %+v", - r.MsgHdr.Id, dns.TypeToString[q.Qtype], q) + r.MsgHdr.Id, dns.TypeToString[q.Qtype], q) m := makeDNSNotImplResponse(r) s.cache.Put(r, m, negLocalTTL, 0, now) w.WriteMsg(m) diff --git a/weavedns/main.go b/weavedns/main.go index 8891d40c..476282b8 100644 --- a/weavedns/main.go +++ b/weavedns/main.go @@ -53,7 +53,7 @@ func main() { } InitDefaultLogging(debug) - Info.Printf("WeaveDNS version %s\n", version) // first thing in log: the version + Info.Printf("WeaveDNS version %s\n", version) // first thing in log: the version var zone = new(weavedns.ZoneDb)