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:
parent
47719756fe
commit
eb59e79207
5 changed files with 6 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue