Skip to content

Commit

Permalink
Prevent an error from being thrown on go help (#2701)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobiNino authored Sep 19, 2024
1 parent 0f6ddbf commit 360095a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions buildtools/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,9 @@ func extractThreadsFlag(args []string) (cleanArgs []string, threadsCount int, er
}

func GoCmd(c *cli.Context) error {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
}
configFilePath, err := goCmdVerification(c)
if err != nil {
return err
Expand All @@ -664,6 +667,9 @@ func GoCmd(c *cli.Context) error {
}

func GoPublishCmd(c *cli.Context) (err error) {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return err
}
configFilePath, err := goCmdVerification(c)
if err != nil {
return err
Expand All @@ -684,9 +690,6 @@ func GoPublishCmd(c *cli.Context) (err error) {
}

func goCmdVerification(c *cli.Context) (string, error) {
if show, err := cliutils.ShowCmdHelpIfNeeded(c, c.Args()); show || err != nil {
return "", err
}
if c.NArg() < 1 {
return "", cliutils.WrongNumberOfArgumentsHandler(c)
}
Expand Down

0 comments on commit 360095a

Please sign in to comment.