Fix some lints (#17337)

Fix some linting problems.
This commit is contained in:
Lunny Xiao
2021-10-18 03:47:12 +08:00
committed by GitHub
parent 5326f4c9c5
commit 4a57c9ea17
8 changed files with 14 additions and 15 deletions

View File

@ -29,9 +29,7 @@ func endpointFromCloneURL(rawurl string) *url.URL {
return ep
}
if strings.HasSuffix(ep.Path, "/") {
ep.Path = ep.Path[:len(ep.Path)-1]
}
ep.Path = strings.TrimSuffix(ep.Path, "/")
if ep.Scheme == "file" {
return ep