Skip to content

Commit 5a7aa57

Browse files
author
Paola Nicosia
committed
fix: lint
1 parent d9e1f04 commit 5a7aa57

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

internal/cmd/item-type-definition/delete.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ func DeleteCmd(options *clioptions.CLIOptions) *cobra.Command {
8282

8383
ITDFlagName := options.AddItemTypeDefinitionNameFlag(cmd.Flags())
8484

85-
cmd.MarkFlagRequired(ITDFlagName)
85+
err := cmd.MarkFlagRequired(ITDFlagName)
86+
if err != nil {
87+
// the error is only due to a programming error (missing command flag), hence panic
88+
panic(err)
89+
}
8690

8791
return cmd
8892
}

internal/cmd/item-type-definition/get.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ func GetCmd(options *clioptions.CLIOptions) *cobra.Command {
6969

7070
nameFlagName := options.AddItemTypeDefinitionNameFlag(cmd.Flags())
7171

72-
cmd.MarkFlagRequired(nameFlagName)
72+
err := cmd.MarkFlagRequired(nameFlagName)
73+
if err != nil {
74+
// the error is only due to a programming error (missing command flag), hence panic
75+
panic(err)
76+
}
7377

7478
return cmd
7579
}

internal/resources/item-type-definition/item-type-definition.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ type GenericItemTypeDefinition map[string]interface{}
3434

3535
type ItemTypeDefinitionMetadataVisibility struct {
3636
Scope string `json:"scope"`
37-
Ids []string `json:"ids"`
37+
IDs []string `json:"ids"` //nolint: tagliatelle
3838
}
3939

4040
type ItemTypeDefinitionMetadataNamespace struct {
4141
Scope string `json:"scope"`
42-
Id string `json:"id"`
42+
ID string `json:"id"`
4343
}
4444

4545
type ItemTypeDefinitionMetadataPublisher struct {

0 commit comments

Comments
 (0)