registry: trimV1Address(): simplify trimming trailing slash
strings.TrimSuffix() does exactly the same as this code, but is
a bit more readable.
@@ -77,10 +77,7 @@ func trimV1Address(address string) (string, error) {
apiVersionStr string
)
- if strings.HasSuffix(address, "/") {
- address = address[:len(address)-1]
- }
-
+ address = strings.TrimSuffix(address, "/")
chunks = strings.Split(address, "/")
apiVersionStr = chunks[len(chunks)-1]
if apiVersionStr == "v1" {
