diff --git a/.golangci.yml b/.golangci.yml index 2e9eb318d..a43a00d96 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,6 +13,7 @@ linters: - govet - ineffassign - intrange + - nakedret - nolintlint - prealloc - protogetter diff --git a/plugin/file/tree/tree.go b/plugin/file/tree/tree.go index a6caafe16..e69befabf 100644 --- a/plugin/file/tree/tree.go +++ b/plugin/file/tree/tree.go @@ -213,7 +213,7 @@ func (n *Node) insert(rr dns.RR) (root *Node, d int) { root = n - return + return root, d } // DeleteMin deletes the node with the minimum value in the tree. diff --git a/plugin/loadbalance/loadbalance_test.go b/plugin/loadbalance/loadbalance_test.go index c46d96842..02a984271 100644 --- a/plugin/loadbalance/loadbalance_test.go +++ b/plugin/loadbalance/loadbalance_test.go @@ -192,7 +192,7 @@ func countRecords(result []dns.RR) (cname int, address int, mx int, sorted bool) state = Any } } - return + return cname, address, mx, sorted } func handler() plugin.Handler { diff --git a/plugin/rewrite/name.go b/plugin/rewrite/name.go index 00f682ef9..42c0054a5 100644 --- a/plugin/rewrite/name.go +++ b/plugin/rewrite/name.go @@ -417,7 +417,7 @@ func parseAnswerRules(name string, args []string) (auto bool, rules ResponseRule if auto && nameRules > 0 { return false, nil, fmt.Errorf("auto name answer rule cannot be combined with explicit name anwer rules") } - return + return auto, rules, nil } // hasClosingDot returns true if s has a closing dot at the end. diff --git a/plugin/template/setup.go b/plugin/template/setup.go index 56058f032..cb2c706f1 100644 --- a/plugin/template/setup.go +++ b/plugin/template/setup.go @@ -158,5 +158,5 @@ func templateParse(c *caddy.Controller) (handler Handler, err error) { handler.Templates = append(handler.Templates, t) } - return + return handler, nil }