diff options
author | 2018-02-14 07:00:04 -0800 | |
---|---|---|
committer | 2018-02-14 10:00:04 -0500 | |
commit | 4e63d0be355b1e3066f8d2d85e53ce7b821b4ab3 (patch) | |
tree | 50917b17272eb4b566773aa05eb85baf994498c6 | |
parent | caf2553d7a39b5f0e69f5b4780c5ff03ff19c883 (diff) | |
download | coredns-4e63d0be355b1e3066f8d2d85e53ce7b821b4ab3.tar.gz coredns-4e63d0be355b1e3066f8d2d85e53ce7b821b4ab3.tar.zst coredns-4e63d0be355b1e3066f8d2d85e53ce7b821b4ab3.zip |
Enable goimports check, and fixes several imports format (#1525)
This fix enables goimports check and fixes several imports format
so that the import sections are prettier, e.g.:
```
import (
- "github.com/miekg/dns"
"regexp"
"strconv"
"strings"
+
+ "github.com/miekg/dns"
)
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | plugin/dnstap/setup_test.go | 3 | ||||
-rw-r--r-- | plugin/rewrite/name.go | 5 | ||||
-rw-r--r-- | plugin/rewrite/reverter.go | 3 |
4 files changed, 8 insertions, 5 deletions
@@ -78,7 +78,7 @@ gen: linter: go get -u github.com/alecthomas/gometalinter gometalinter --install golint - gometalinter --deadline=1m --disable-all --enable=gofmt --enable=golint --enable=vet --exclude=^vendor/ --exclude=^pb/ ./... + gometalinter --deadline=2m --disable-all --enable=gofmt --enable=golint --enable=vet --enable=goimports --exclude=^vendor/ --exclude=^pb/ ./... .PHONY: clean clean: diff --git a/plugin/dnstap/setup_test.go b/plugin/dnstap/setup_test.go index fc1dc98e0..efac6aa56 100644 --- a/plugin/dnstap/setup_test.go +++ b/plugin/dnstap/setup_test.go @@ -1,8 +1,9 @@ package dnstap import ( - "github.com/mholt/caddy" "testing" + + "github.com/mholt/caddy" ) func TestConfig(t *testing.T) { diff --git a/plugin/rewrite/name.go b/plugin/rewrite/name.go index 6d7a02632..6cbe9d327 100644 --- a/plugin/rewrite/name.go +++ b/plugin/rewrite/name.go @@ -2,11 +2,12 @@ package rewrite import ( "fmt" - "github.com/coredns/coredns/plugin" - "github.com/miekg/dns" "regexp" "strconv" "strings" + + "github.com/coredns/coredns/plugin" + "github.com/miekg/dns" ) type nameRule struct { diff --git a/plugin/rewrite/reverter.go b/plugin/rewrite/reverter.go index 2f2354e59..0faae608d 100644 --- a/plugin/rewrite/reverter.go +++ b/plugin/rewrite/reverter.go @@ -1,10 +1,11 @@ package rewrite import ( - "github.com/miekg/dns" "regexp" "strconv" "strings" + + "github.com/miekg/dns" ) // ResponseRule contains a rule to rewrite a response with. |