diff --git a/cmd/model/list.go b/cmd/model/list.go index ac61862..1e2f24d 100644 --- a/cmd/model/list.go +++ b/cmd/model/list.go @@ -95,7 +95,7 @@ var listCmd = &cobra.Command{ models := authorizationmodel.AuthzModelList{} authzModels := response.AuthorizationModels - for index := range len(authzModels) { + for index := range authzModels { authModel := authorizationmodel.AuthzModel{} authModel.Set(authzModels[index]) models.AuthorizationModels = append(models.AuthorizationModels, authModel.DisplayAsJSON(fields)) diff --git a/cmd/query/check.go b/cmd/query/check.go index 7a873e2..092d401 100644 --- a/cmd/query/check.go +++ b/cmd/query/check.go @@ -53,7 +53,7 @@ func check( response, err := fgaClient.Check(context.Background()).Body(*body).Options(*options).Execute() if err != nil { - return nil, fmt.Errorf("failed to check due to %w", err) + return nil, err //nolint:wrapcheck } return response, nil @@ -90,7 +90,7 @@ var checkCmd = &cobra.Command{ response, err := check(fgaClient, args[0], args[1], args[2], contextualTuples, queryContext, consistency) if err != nil { - return fmt.Errorf("failed to check due to %w", err) + return fmt.Errorf("check failed: %w", err) } return output.Display(*response)