Skip to content

Commit

Permalink
fix: buildAlias duplication fixed (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
marnas authored Jan 27, 2025
1 parent d89abf6 commit b036fc6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ func removeTrailingSIfAny(name string) string {
}

func buildAlias(name string) []string {
return []string{strings.ToLower(name), removeTrailingSIfAny(strings.ToLower(name)), removeTrailingSIfAny(name)}
aliases := []string{strings.ToLower(name)}
// This doesn't seem to be needed since none of the kinds ends with an S
// However I'm leaving it here as a conditional so it won't affect the usage
if strings.HasSuffix(name, "s") {
aliases = append(aliases, removeTrailingSIfAny(name), removeTrailingSIfAny(strings.ToLower(name)))
}
return aliases
}

func printResource(result interface{}, format OutputFormat) error {
Expand Down

0 comments on commit b036fc6

Please sign in to comment.