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

@ -46,9 +46,7 @@ func parseConfig(d *caddyfile.Dispenser) (c config, err error) {
c.target = servers[0]
} else {
// default to UNIX socket
if strings.HasPrefix(c.target, "unix://") {
c.target = c.target[7:]
}
c.target = strings.TrimPrefix(c.target, "unix://")
c.socket = true
}