Skip to content

Commit a7795ca

Browse files
committed
format
1 parent cbce8ba commit a7795ca

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/namespaces/iam/v1alpha1/custom_iam.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package iam
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"reflect"
78

@@ -61,15 +62,16 @@ func (a applicationEntity) entityType(ctx context.Context, api *iam.API) (string
6162

6263
func buildEntity(apiKey *iam.APIKey) (entity, error) {
6364
if apiKey == nil {
64-
return nil, fmt.Errorf("invalid API key")
65+
return nil, errors.New("invalid API key")
6566
}
6667
if apiKey.UserID != nil {
6768
return userEntity{UserID: *apiKey.UserID}, nil
6869
}
6970
if apiKey.ApplicationID != nil {
7071
return applicationEntity{ApplicationID: *apiKey.ApplicationID}, nil
7172
}
72-
return nil, fmt.Errorf("invalid API key")
73+
74+
return nil, errors.New("invalid API key")
7375
}
7476

7577
func (u userEntity) getPolicies(ctx context.Context, api *iam.API) ([]*iam.Policy, error) {
@@ -79,6 +81,7 @@ func (u userEntity) getPolicies(ctx context.Context, api *iam.API) ([]*iam.Polic
7981
if err != nil {
8082
return nil, err
8183
}
84+
8285
return policies.Policies, nil
8386
}
8487

@@ -89,6 +92,7 @@ func (a applicationEntity) getPolicies(ctx context.Context, api *iam.API) ([]*ia
8992
if err != nil {
9093
return nil, err
9194
}
95+
9296
return policies.Policies, nil
9397
}
9498

@@ -120,10 +124,7 @@ func getApiKey(
120124
response.EntityType = entityType
121125

122126
if entityType == string(iam.UserTypeOwner) {
123-
response.EntityType = fmt.Sprintf(
124-
"%s (owner has all permissions over the organization)",
125-
entityType,
126-
)
127+
response.EntityType = entityType + " (owner has all permissions over the organization)"
127128

128129
return response, nil
129130
}

internal/namespaces/iam/v1alpha1/custom_iam_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,4 @@ func Test_iamAPIKeyGet(t *testing.T) {
125125
core.TestCheckExitCode(0),
126126
),
127127
}))
128-
129128
}

0 commit comments

Comments
 (0)