all: apply golangci-lint 2.9.0 fixes
Fix issues found by the upgraded golangci-lint: - wsl_v5: add required whitespace in CLI files - staticcheck SA4006: replace new(var.Field) with &localVar pattern since staticcheck does not recognize Go 1.26 new(value) as a use of the variable - staticcheck SA5011: use t.Fatal instead of t.Error for nil guard checks so execution stops - unused: remove dead ptrTo helper function
This commit is contained in:
parent
73613d7f53
commit
43afeedde2
15 changed files with 58 additions and 24 deletions
|
|
@ -112,10 +112,12 @@ var createUserCmd = &cobra.Command{
|
|||
output,
|
||||
)
|
||||
}
|
||||
|
||||
request.PictureUrl = pictureURL
|
||||
}
|
||||
|
||||
log.Trace().Interface(zf.Request, request).Msg("sending CreateUser request")
|
||||
|
||||
response, err := client.CreateUser(ctx, request)
|
||||
if err != nil {
|
||||
ErrorOutput(
|
||||
|
|
@ -167,6 +169,7 @@ var destroyUserCmd = &cobra.Command{
|
|||
user := users.GetUsers()[0]
|
||||
|
||||
confirm := false
|
||||
|
||||
force, _ := cmd.Flags().GetBool("force")
|
||||
if !force {
|
||||
confirm = util.YesNo(fmt.Sprintf(
|
||||
|
|
@ -186,6 +189,7 @@ var destroyUserCmd = &cobra.Command{
|
|||
output,
|
||||
)
|
||||
}
|
||||
|
||||
SuccessOutput(response, "User destroyed", output)
|
||||
} else {
|
||||
SuccessOutput(map[string]string{"Result": "User not destroyed"}, "User not destroyed", output)
|
||||
|
|
@ -246,6 +250,7 @@ var listUsersCmd = &cobra.Command{
|
|||
},
|
||||
)
|
||||
}
|
||||
|
||||
err = pterm.DefaultTable.WithHasHeader().WithData(tableData).Render()
|
||||
if err != nil {
|
||||
ErrorOutput(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue