Skip to content

Commit 696ce71

Browse files
committed
Use cobra.CheckErr for MarkHidden error handling
Replace silent error ignoring with cobra.CheckErr() so any unexpected failures in MarkHidden are properly surfaced.
1 parent d2ff273 commit 696ce71

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/cmd/auth/api/get-access-token/get_access_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
6161

6262
// hide project id flag from help command because it could mislead users
6363
cmd.SetHelpFunc(func(command *cobra.Command, strings []string) {
64-
_ = command.Flags().MarkHidden(globalflags.ProjectIdFlag) // nolint:errcheck // there's no chance to handle the error here
64+
cobra.CheckErr(command.Flags().MarkHidden(globalflags.ProjectIdFlag))
6565
command.Parent().HelpFunc()(command, strings)
6666
})
6767

internal/cmd/auth/get-access-token/get_access_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
7070

7171
// hide project id flag from help command because it could mislead users
7272
cmd.SetHelpFunc(func(command *cobra.Command, strings []string) {
73-
_ = command.Flags().MarkHidden(globalflags.ProjectIdFlag) // nolint:errcheck // there's no chance to handle the error here
73+
cobra.CheckErr(command.Flags().MarkHidden(globalflags.ProjectIdFlag))
7474
command.Parent().HelpFunc()(command, strings)
7575
})
7676

0 commit comments

Comments
 (0)