From 77dd05caad3be37e0c4c09d8efebfad21e607671 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 13 Jun 2023 13:47:56 +0200 Subject: [PATCH] cli/command/image: remove errStdinConflict This error was only used in a single location, so no need to define a package-level variable for this. Signed-off-by: Sebastiaan van Stijn --- cli/command/image/build.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/command/image/build.go b/cli/command/image/build.go index 27b6cafd87..dd7510c440 100644 --- a/cli/command/image/build.go +++ b/cli/command/image/build.go @@ -34,8 +34,6 @@ import ( "github.com/spf13/cobra" ) -var errStdinConflict = errors.New("invalid argument: can't use stdin for both build context and dockerfile") - type buildOptions struct { context string dockerfileName string @@ -189,7 +187,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error { if options.dockerfileFromStdin() { if options.contextFromStdin() { - return errStdinConflict + return errors.New("invalid argument: can't use stdin for both build context and dockerfile") } dockerfileCtx = dockerCli.In() }