Skip to content

Commit a55cfe5

Browse files
committed
cli/command: PromptUserForCredentials: inline isDefaultRegistry
remove isDefaultRegistry and inline it where it's used; the code-comment already outlines what we're looking for, so the intermediate var didn't add much currently. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 3a84850 commit a55cfe5

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

cli/command/registry.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,10 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
123123
cli.SetIn(streams.NewIn(os.Stdin))
124124
}
125125

126-
isDefaultRegistry := serverAddress == registry.IndexServer
127126
defaultUsername = strings.TrimSpace(defaultUsername)
128127

129128
if argUser = strings.TrimSpace(argUser); argUser == "" {
130-
if isDefaultRegistry {
129+
if serverAddress == registry.IndexServer {
131130
// if this is a default registry (docker hub), then display the following message.
132131
fmt.Fprintln(cli.Out(), "Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.")
133132
if hints.Enabled() {

0 commit comments

Comments
 (0)