Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 77863b6

Browse files
Refactoring: move firstOrEmtpy function to validate command, as it is the last command still using it
Signed-off-by: Silvin Lubecki <[email protected]>
1 parent ada2191 commit 77863b6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/commands/root.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ func removeExperimentalCmdsAndFlags(cmd *cobra.Command) {
9696
}
9797
}
9898

99-
func firstOrEmpty(list []string) string {
100-
if len(list) != 0 {
101-
return list[0]
102-
}
103-
return ""
104-
}
105-
10699
func muteDockerCli(dockerCli command.Cli) func() {
107100
stdout := dockerCli.Out()
108101
stderr := dockerCli.Err()

internal/commands/validate.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ func runValidate(args []string, opts validateOptions) error {
6262
fmt.Fprintf(os.Stdout, "Validated %q\n", app.Path)
6363
return nil
6464
}
65+
66+
func firstOrEmpty(list []string) string {
67+
if len(list) != 0 {
68+
return list[0]
69+
}
70+
return ""
71+
}

0 commit comments

Comments
 (0)