Skip to content

Commit

Permalink
Removing unncessary condition
Browse files Browse the repository at this point in the history
It was pointed out that strings.TrimSuffix already contained the functionality added here, removing the conditional that added HasSuffix

Signed-off-by: donuts-are-good <[email protected]>
  • Loading branch information
donuts-are-good authored Oct 19, 2023
1 parent a59285c commit d69887f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ func computeRoutePrefix(prefix string, externalURL *url.URL) string {
prefix = "/" + prefix
}

// Ensure prefix does not end with "/".
if strings.HasSuffix(prefix, "/") {
prefix = strings.TrimSuffix(prefix, "/")
}
prefix = strings.TrimSuffix(prefix, "/")

return prefix
}
Expand Down

0 comments on commit d69887f

Please sign in to comment.