diff options
author | 2019-06-25 08:00:33 +0100 | |
---|---|---|
committer | 2019-06-25 15:00:33 +0800 | |
commit | cd176f859b2e71d8919c56ff67235c226ab5b48e (patch) | |
tree | e1ee9a8c19d3e198627e289dd998caebfa53bb21 /plugin/rewrite/ttl_test.go | |
parent | 123628dc469ec90b2414931988ee27993d2d9648 (diff) | |
download | coredns-cd176f859b2e71d8919c56ff67235c226ab5b48e.tar.gz coredns-cd176f859b2e71d8919c56ff67235c226ab5b48e.tar.zst coredns-cd176f859b2e71d8919c56ff67235c226ab5b48e.zip |
Run gofmt -s and golint on the codebase (#2918)
* Run gofmt -s and golint on the codebase
Run golint and fix everythign it flagged (except the context arg
ordering), mostly edits in the rewrite plugin.
Signed-off-by: Miek Gieben <miek@miek.nl>
* ... and ofcourse the test as well
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/rewrite/ttl_test.go')
-rw-r--r-- | plugin/rewrite/ttl_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugin/rewrite/ttl_test.go b/plugin/rewrite/ttl_test.go index 5ede4cdae..359807299 100644 --- a/plugin/rewrite/ttl_test.go +++ b/plugin/rewrite/ttl_test.go @@ -12,7 +12,7 @@ import ( "github.com/miekg/dns" ) -func TestNewTtlRule(t *testing.T) { +func TestNewTTLRule(t *testing.T) { tests := []struct { next string args []string @@ -36,7 +36,7 @@ func TestNewTtlRule(t *testing.T) { } for i, tc := range tests { failed := false - rule, err := newTtlRule(tc.next, tc.args...) + rule, err := newTTLRule(tc.next, tc.args...) if err != nil { failed = true } @@ -71,13 +71,13 @@ func TestTtlRewrite(t *testing.T) { args []string expectedType reflect.Type }{ - {[]string{"stop", "ttl", "srv1.coredns.rocks", "1"}, reflect.TypeOf(&exactTtlRule{})}, - {[]string{"stop", "ttl", "exact", "srv15.coredns.rocks", "15"}, reflect.TypeOf(&exactTtlRule{})}, - {[]string{"stop", "ttl", "prefix", "srv30", "30"}, reflect.TypeOf(&prefixTtlRule{})}, - {[]string{"stop", "ttl", "suffix", "45.coredns.rocks", "45"}, reflect.TypeOf(&suffixTtlRule{})}, - {[]string{"stop", "ttl", "substring", "rv50", "50"}, reflect.TypeOf(&substringTtlRule{})}, - {[]string{"stop", "ttl", "regex", `(srv10)\.(coredns)\.(rocks)`, "10"}, reflect.TypeOf(®exTtlRule{})}, - {[]string{"stop", "ttl", "regex", `(srv20)\.(coredns)\.(rocks)`, "20"}, reflect.TypeOf(®exTtlRule{})}, + {[]string{"stop", "ttl", "srv1.coredns.rocks", "1"}, reflect.TypeOf(&exactTTLRule{})}, + {[]string{"stop", "ttl", "exact", "srv15.coredns.rocks", "15"}, reflect.TypeOf(&exactTTLRule{})}, + {[]string{"stop", "ttl", "prefix", "srv30", "30"}, reflect.TypeOf(&prefixTTLRule{})}, + {[]string{"stop", "ttl", "suffix", "45.coredns.rocks", "45"}, reflect.TypeOf(&suffixTTLRule{})}, + {[]string{"stop", "ttl", "substring", "rv50", "50"}, reflect.TypeOf(&substringTTLRule{})}, + {[]string{"stop", "ttl", "regex", `(srv10)\.(coredns)\.(rocks)`, "10"}, reflect.TypeOf(®exTTLRule{})}, + {[]string{"stop", "ttl", "regex", `(srv20)\.(coredns)\.(rocks)`, "20"}, reflect.TypeOf(®exTTLRule{})}, } for i, r := range ruleset { rule, err := newRule(r.args...) @@ -90,10 +90,10 @@ func TestTtlRewrite(t *testing.T) { } rules = append(rules, rule) } - doTtlTests(rules, t) + doTTLTests(rules, t) } -func doTtlTests(rules []Rule, t *testing.T) { +func doTTLTests(rules []Rule, t *testing.T) { tests := []struct { from string fromType uint16 |