Skip to content

Commit d79ba80

Browse files
committed
Adderss linter comments
Signed-off-by: Ben <[email protected]>
1 parent 8c4e21b commit d79ba80

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

pkg/sts/sts.go

+23-5
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ func CmdCreate() *cobra.Command {
3535
Run: RunUpdate,
3636
}
3737
cmd.Flags().String("email", "", "The email of the account that will be updated")
38-
cmd.MarkFlagRequired("email")
38+
err := cmd.MarkFlagRequired("email")
39+
if err != nil {
40+
log.Fatalf(`❌ Failed to mark email flag as required - %s`, err)
41+
}
3942
cmd.Flags().String("role_config", "", "The new value that the account's role_config should be set to")
40-
cmd.MarkFlagRequired("role_config")
43+
err = cmd.MarkFlagRequired("role_config")
44+
if err != nil {
45+
log.Fatalf(`❌ Failed to mark role_config flag as required - %s`, err)
46+
}
4147
return cmd
4248
}
4349

@@ -49,9 +55,15 @@ func CmdUpdate() *cobra.Command {
4955
Run: RunUpdate,
5056
}
5157
cmd.Flags().String("email", "", "The email of the account that will be updated")
52-
cmd.MarkFlagRequired("email")
58+
err := cmd.MarkFlagRequired("email")
59+
if err != nil {
60+
log.Fatalf(`❌ Failed to mark email flag as required - %s`, err)
61+
}
5362
cmd.Flags().String("role_config", "", "The new value that the account's role_config should be set to")
54-
cmd.MarkFlagRequired("role_config")
63+
err = cmd.MarkFlagRequired("role_config")
64+
if err != nil {
65+
log.Fatalf(`❌ Failed to mark role_config flag as required - %s`, err)
66+
}
5567
return cmd
5668
}
5769

@@ -63,7 +75,10 @@ func CmdRemove() *cobra.Command {
6375
Run: RunRemove,
6476
}
6577
cmd.Flags().String("email", "", "The email of the account that will be updated")
66-
cmd.MarkFlagRequired("email")
78+
err := cmd.MarkFlagRequired("email")
79+
if err != nil {
80+
log.Fatalf(`❌ Failed to mark email flag as required - %s`, err)
81+
}
6782
return cmd
6883
}
6984

@@ -90,6 +105,9 @@ func RunUpdate(cmd *cobra.Command, args []string) {
90105
}
91106
readAccountParams := nb.ReadAccountParams{Email: email}
92107
accountInfo, err := NBClient.ReadAccountAPI(readAccountParams)
108+
if err != nil {
109+
log.Fatalf(`❌ Failed to read account - %s`, err)
110+
}
93111
UpdateAccountParams := nb.UpdateAccountParams{
94112
Email: email,
95113
AllowedIPs: accountInfo.AllowedIPs,

0 commit comments

Comments
 (0)