plugin: cleanup code based on staticcheck warnings (#3302)

TrimPrefix re-assign to former variable

Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
This commit is contained in:
Guangming Wang
2019-09-25 20:23:43 +08:00
committed by Miek Gieben
parent 47719756fe
commit eb59e79207
5 changed files with 6 additions and 10 deletions

View File

@@ -27,9 +27,7 @@ func (t *testResponseWriter) WriteMsg(m *dns.Msg) error {
func NewTestControllerWithZones(input string, zones []string) *caddy.Controller {
ctr := caddy.NewTestController("dns", input)
for _, zone := range zones {
ctr.ServerBlockKeys = append(ctr.ServerBlockKeys, zone)
}
ctr.ServerBlockKeys = append(ctr.ServerBlockKeys, zones...)
return ctr
}