Add unparam linter

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin
2017-06-09 17:16:56 -04:00
parent 3bf0317fea
commit 3e3934c19f
9 changed files with 36 additions and 54 deletions

View File

@ -2,6 +2,7 @@ package swarm
import (
"fmt"
"io"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
@ -74,16 +75,15 @@ func runUnlockKey(dockerCli command.Cli, opts unlockKeyOptions) error {
return nil
}
printUnlockCommand(ctx, dockerCli, unlockKeyResp.UnlockKey)
printUnlockCommand(dockerCli.Out(), unlockKeyResp.UnlockKey)
return nil
}
func printUnlockCommand(ctx context.Context, dockerCli command.Cli, unlockKey string) {
func printUnlockCommand(out io.Writer, unlockKey string) {
if len(unlockKey) > 0 {
fmt.Fprintf(dockerCli.Out(), "To unlock a swarm manager after it restarts, "+
fmt.Fprintf(out, "To unlock a swarm manager after it restarts, "+
"run the `docker swarm unlock`\ncommand and provide the following key:\n\n %s\n\n"+
"Please remember to store this key in a password manager, since without it you\n"+
"will not be able to restart the manager.\n", unlockKey)
}
return
}