aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-10-01 07:41:29 +0100
committerGravatar GitHub <noreply@github.com> 2019-10-01 07:41:29 +0100
commitdbd1c047cb973fc669fbe4e97dc12e7b3d3e6ed8 (patch)
tree4737fb65ef07bdfd3e24e2c76a147edde5db852c /plugin/rewrite
parent55a01dadaacc33674aff1e936b101695f9de32cf (diff)
downloadcoredns-dbd1c047cb973fc669fbe4e97dc12e7b3d3e6ed8.tar.gz
coredns-dbd1c047cb973fc669fbe4e97dc12e7b3d3e6ed8.tar.zst
coredns-dbd1c047cb973fc669fbe4e97dc12e7b3d3e6ed8.zip
Run gostaticheck (#3325)
* Run gostaticheck Run gostaticcheck on the codebase and fix almost all flagged items. Only keep * coremain/run.go:192:2: var appVersion is unused (U1000) * plugin/chaos/setup.go:54:3: the surrounding loop is unconditionally terminated (SA4004) * plugin/etcd/setup.go:103:3: the surrounding loop is unconditionally terminated (SA4004) * plugin/pkg/replacer/replacer.go:274:13: argument should be pointer-like to avoid allocations (SA6002) * plugin/route53/setup.go:124:28: session.New is deprecated: Use NewSession functions to create sessions instead. NewSession has the same functionality as New except an error can be returned when the func is called instead of waiting to receive an error until a request is made. (SA1019) * test/grpc_test.go:25:69: grpc.WithTimeout is deprecated: use DialContext and context.WithTimeout instead. Will be supported throughout 1.x. (SA1019) The first one isn't true, as this is set via ldflags. The rest is minor. The deprecation should be fixed at some point; I'll file some issues. Signed-off-by: Miek Gieben <miek@miek.nl> * Make sure to plug in the plugins import the plugins, that file that did this was removed, put it in the reload test as this requires an almost complete coredns server. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/rewrite')
-rw-r--r--plugin/rewrite/name.go2
-rw-r--r--plugin/rewrite/rewrite.go1
-rw-r--r--plugin/rewrite/setup.go3
-rw-r--r--plugin/rewrite/ttl.go2
4 files changed, 2 insertions, 6 deletions
diff --git a/plugin/rewrite/name.go b/plugin/rewrite/name.go
index 9302d563a..7a8f9ad7c 100644
--- a/plugin/rewrite/name.go
+++ b/plugin/rewrite/name.go
@@ -195,7 +195,7 @@ func newNameRule(nextAction string, args ...string) (Rule, error) {
},
}, nil
default:
- return nil, fmt.Errorf("A name rule supports only exact, prefix, suffix, substring, and regex name matching, received: %s", matchType)
+ return nil, fmt.Errorf("name rule supports only exact, prefix, suffix, substring, and regex name matching, received: %s", matchType)
}
}
if len(args) == 7 {
diff --git a/plugin/rewrite/rewrite.go b/plugin/rewrite/rewrite.go
index 2eabf6df2..13e1d2092 100644
--- a/plugin/rewrite/rewrite.go
+++ b/plugin/rewrite/rewrite.go
@@ -61,7 +61,6 @@ func (rw Rewrite) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
return plugin.NextOrFailure(rw.Name(), rw.Next, ctx, wr, r)
}
case RewriteIgnored:
- break
}
}
if rw.noRevert || len(wr.ResponseRules) == 0 {
diff --git a/plugin/rewrite/setup.go b/plugin/rewrite/setup.go
index 6b6bcce66..8c2890c62 100644
--- a/plugin/rewrite/setup.go
+++ b/plugin/rewrite/setup.go
@@ -3,13 +3,10 @@ package rewrite
import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
- clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/caddyserver/caddy"
)
-var log = clog.NewWithPlugin("rewrite")
-
func init() { plugin.Register("rewrite", setup) }
func setup(c *caddy.Controller) error {
diff --git a/plugin/rewrite/ttl.go b/plugin/rewrite/ttl.go
index 73445dfc9..59ed9f52a 100644
--- a/plugin/rewrite/ttl.go
+++ b/plugin/rewrite/ttl.go
@@ -159,7 +159,7 @@ func newTTLRule(nextAction string, args ...string) (Rule, error) {
},
}, nil
default:
- return nil, fmt.Errorf("A ttl rule supports only exact, prefix, suffix, substring, and regex name matching")
+ return nil, fmt.Errorf("ttl rule supports only exact, prefix, suffix, substring, and regex name matching")
}
}
if len(args) > 3 {