Skip to content

Commit 4b7a1e4

Browse files
committed
cli/command: PromptUserForCredentials: suppress unhandled errors
Keep the linters (and my IDE) happy; these errors should be safe to ignore. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 378a3d7 commit 4b7a1e4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

cli/command/registry.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ const (
3030
// for the given command.
3131
func RegistryAuthenticationPrivilegedFunc(cli Cli, index *registrytypes.IndexInfo, cmdName string) registrytypes.RequestAuthConfig {
3232
return func(ctx context.Context) (string, error) {
33-
fmt.Fprintf(cli.Out(), "\nLogin prior to %s:\n", cmdName)
33+
_, _ = fmt.Fprintf(cli.Out(), "\nLogin prior to %s:\n", cmdName)
3434
indexServer := registry.GetAuthConfigKey(index)
3535
isDefaultRegistry := indexServer == registry.IndexServer
3636
authConfig, err := GetDefaultAuthConfig(cli.ConfigFile(), true, indexServer, isDefaultRegistry)
3737
if err != nil {
38-
fmt.Fprintf(cli.Err(), "Unable to retrieve stored credentials for %s, error: %s.\n", indexServer, err)
38+
_, _ = fmt.Fprintf(cli.Err(), "Unable to retrieve stored credentials for %s, error: %s.\n", indexServer, err)
3939
}
4040

4141
select {
@@ -135,8 +135,8 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
135135
// a token instead of a password.
136136
_, _ = fmt.Fprintln(cli.Out(), registerSuggest)
137137
if hints.Enabled() {
138-
fmt.Fprintln(cli.Out(), patSuggest)
139-
fmt.Fprintln(cli.Out())
138+
_, _ = fmt.Fprintln(cli.Out(), patSuggest)
139+
_, _ = fmt.Fprintln(cli.Out())
140140
}
141141
}
142142

@@ -181,7 +181,7 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
181181
if err != nil {
182182
return registrytypes.AuthConfig{}, err
183183
}
184-
fmt.Fprint(cli.Out(), "\n")
184+
_, _ = fmt.Fprintln(cli.Out())
185185
if argPassword == "" {
186186
return registrytypes.AuthConfig{}, errors.Errorf("Error: Password Required")
187187
}

0 commit comments

Comments
 (0)