Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindh <[email protected]>
  • Loading branch information
arvindh123 committed Jul 12, 2024
1 parent 20f0d7f commit a900094
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions auth/pat.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,17 @@ const (
PlatformDomainsScope
)

const (
platformUsersScopeStr = "users"
platformDomainsScopeStr = "domains"
)

func (pet PlatformEntityType) ValidString() (string, error) {
switch pet {
case PlatformUsersScope:
return "users", nil
return platformUsersScopeStr, nil
case PlatformDomainsScope:
return "domains", nil
return platformDomainsScopeStr, nil
default:
return "", fmt.Errorf("unknown platform entity type %d", pet)
}
Expand All @@ -195,19 +200,19 @@ func (pet PlatformEntityType) ValidString() (string, error) {
func (pet PlatformEntityType) String() string {
switch pet {
case PlatformUsersScope:
return "users"
return platformUsersScopeStr
case PlatformDomainsScope:
return "domains"
return platformDomainsScopeStr
default:
return fmt.Sprintf("unknown platform entity type %d", pet)
}
}

func ParsePlatformEntityType(pet string) (PlatformEntityType, error) {
switch pet {
case "users":
case platformUsersScopeStr:
return PlatformUsersScope, nil
case "domains":
case platformDomainsScopeStr:
return PlatformDomainsScope, nil
default:
return 0, fmt.Errorf("unknown platform entity type %s", pet)
Expand Down

0 comments on commit a900094

Please sign in to comment.