Skip to content

Commit 098245b

Browse files
committed
registry: refactor maybePrintEnvAuthWarning function
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
1 parent ac9b37e commit 098245b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

cli/command/registry/warning.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@ package registry
33
import (
44
"os"
55

6+
"github.com/docker/cli/cli/command"
67
"github.com/docker/cli/cli/config/configfile"
7-
"github.com/docker/cli/cli/streams"
88
"github.com/docker/cli/internal/tui"
99
)
1010

11-
type outErr interface {
12-
Err() *streams.Out
13-
}
14-
1511
// maybePrintEnvAuthWarning if the `DOCKER_AUTH_CONFIG` environment variable is
1612
// set this function will output a warning to stdErr
17-
func maybePrintEnvAuthWarning(out outErr) {
13+
func maybePrintEnvAuthWarning(out command.Streams) {
1814
if os.Getenv(configfile.DockerEnvConfigKey) != "" {
19-
out := tui.NewOutput(out.Err())
20-
out.PrintWarning("%[1]s is set and takes precedence.\nUnset %[1]s to restore the CLI auth behaviour.\n", configfile.DockerEnvConfigKey)
15+
tui.NewOutput(out.Err()).
16+
PrintWarning("%[1]s is set and takes precedence.\nUnset %[1]s to restore the CLI auth behaviour.\n", configfile.DockerEnvConfigKey)
2117
}
2218
}

0 commit comments

Comments
 (0)