1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Remove useless if-else

It is better to use simple form without else.

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
Hu Keping 2015-08-08 19:47:27 +08:00
parent 196aa6d62d
commit c536cec5ea

View file

@ -26,13 +26,14 @@ func (cli *DockerCli) CmdLogout(args ...string) error {
if _, ok := cli.configFile.AuthConfigs[serverAddress]; !ok { if _, ok := cli.configFile.AuthConfigs[serverAddress]; !ok {
fmt.Fprintf(cli.out, "Not logged in to %s\n", serverAddress) fmt.Fprintf(cli.out, "Not logged in to %s\n", serverAddress)
} else { return nil
fmt.Fprintf(cli.out, "Remove login credentials for %s\n", serverAddress)
delete(cli.configFile.AuthConfigs, serverAddress)
if err := cli.configFile.Save(); err != nil {
return fmt.Errorf("Failed to save docker config: %v", err)
}
} }
fmt.Fprintf(cli.out, "Remove login credentials for %s\n", serverAddress)
delete(cli.configFile.AuthConfigs, serverAddress)
if err := cli.configFile.Save(); err != nil {
return fmt.Errorf("Failed to save docker config: %v", err)
}
return nil return nil
} }