From 69630f37fcebe894b15872148bd8b2496806b60c Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Sun, 11 Feb 2018 23:56:49 -0800 Subject: vet: eliminate unnecessary shadowing Running "go vet -shadow ./..." finds all places where a variable might be incorrectly or unnecessarily shadowed. This fixes some of them. --- cmd/fscrypt/commands.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd/fscrypt') diff --git a/cmd/fscrypt/commands.go b/cmd/fscrypt/commands.go index 2f23a0f..66450c7 100644 --- a/cmd/fscrypt/commands.go +++ b/cmd/fscrypt/commands.go @@ -519,7 +519,7 @@ func createProtectorAction(c *cli.Context) error { } prompt := fmt.Sprintf("Create new protector on %q", ctx.Mount.Path) - if err := askConfirmation(prompt, true, ""); err != nil { + if err = askConfirmation(prompt, true, ""); err != nil { return newExitError(c, err) } @@ -561,20 +561,20 @@ func createPolicyAction(c *cli.Context) error { return newExitError(c, err) } - if err := checkRequiredFlags(c, []*stringFlag{protectorFlag}); err != nil { + if err = checkRequiredFlags(c, []*stringFlag{protectorFlag}); err != nil { return err } protector, err := getProtectorFromFlag(protectorFlag.Value, ctx.TargetUser) if err != nil { return newExitError(c, err) } - if err := protector.Unlock(existingKeyFn); err != nil { + if err = protector.Unlock(existingKeyFn); err != nil { return newExitError(c, err) } defer protector.Lock() prompt := fmt.Sprintf("Create new policy on %q", ctx.Mount.Path) - if err := askConfirmation(prompt, true, ""); err != nil { + if err = askConfirmation(prompt, true, ""); err != nil { return newExitError(c, err) } -- cgit v1.2.3