Skip to content

Commit 883a1c3

Browse files
committed
Add MarkFlagRequired to exceptions
1 parent 09a2a40 commit 883a1c3

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.golangci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ linters-settings:
1818
replacement: 'any'
1919
errcheck:
2020
exclude-functions:
21-
- (*github.com/spf13/pflag.FlagSet).MarkHidden
22-
- (*github.com/spf13/pflag.FlagSet).MarkDeprecated
2321
- (*github.com/spf13/cobra.Command).RegisterFlagCompletionFunc
22+
- (*github.com/spf13/cobra.Command).MarkFlagRequired
23+
- (*github.com/spf13/pflag.FlagSet).MarkDeprecated
24+
- (*github.com/spf13/pflag.FlagSet).MarkHidden
2425
issues:
2526
exclude-dirs-use-default: false # recommended by docs https://golangci-lint.run/usage/false-positives/

cmd/bundle/generate/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func NewGenerateJobCommand() *cobra.Command {
3030
}
3131

3232
cmd.Flags().Int64Var(&jobId, "existing-job-id", 0, `Job ID of the job to generate config for`)
33-
_ = cmd.MarkFlagRequired("existing-job-id")
33+
cmd.MarkFlagRequired("existing-job-id")
3434

3535
wd, err := os.Getwd()
3636
if err != nil {

cmd/bundle/generate/pipeline.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func NewGeneratePipelineCommand() *cobra.Command {
3030
}
3131

3232
cmd.Flags().StringVar(&pipelineId, "existing-pipeline-id", "", `ID of the pipeline to generate config for`)
33-
_ = cmd.MarkFlagRequired("existing-pipeline-id")
33+
cmd.MarkFlagRequired("existing-pipeline-id")
3434

3535
wd, err := os.Getwd()
3636
if err != nil {

0 commit comments

Comments
 (0)