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

@@ -83,7 +83,7 @@ func (e *Etcd) Records(ctx context.Context, state request.Request, exact bool) (
func (e *Etcd) get(ctx context.Context, path string, recursive bool) (*etcdcv3.GetResponse, error) {
ctx, cancel := context.WithTimeout(ctx, etcdTimeout)
defer cancel()
if recursive == true {
if recursive {
if !strings.HasSuffix(path, "/") {
path = path + "/"
}