It seems like it would be reasonably to just look at the end of the path, rather than assuming the entire path is only the version URL.
It seems that we only strip of a trailing '/', so probably we could do:
path := strings.TrimSuffix(strings.ToLower(url.Path), "/")
_, versionNumStr := path.Split(path)
versionNumStr = strings.TrimPrefix("v")
It seems like it would be reasonably to just look at the end of the path, rather than assuming the entire path is only the version URL.
It seems that we only strip of a trailing '/', so probably we could do: TrimSuffix( strings. ToLower( url.Path) , "/") TrimPrefix( "v")
path := strings.
_, versionNumStr := path.Split(path)
versionNumStr = strings.