We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4bbacd3 commit 2a93ac9Copy full SHA for 2a93ac9
arduino/libraries/librariesmanager/install.go
@@ -240,12 +240,12 @@ func parseGitURL(gitURL string) (string, error) {
240
if strings.HasPrefix(gitURL, "git@") {
241
// We can't parse these as URLs
242
i := strings.LastIndex(gitURL, "/")
243
- res = strings.TrimRight(gitURL[i+1:], ".git")
+ res = strings.TrimSuffix(gitURL[i+1:], ".git")
244
} else if path := paths.New(gitURL); path.Exist() {
245
res = path.Base()
246
} else if parsed, err := url.Parse(gitURL); err == nil {
247
i := strings.LastIndex(parsed.Path, "/")
248
- res = strings.TrimRight(parsed.Path[i+1:], ".git")
+ res = strings.TrimSuffix(parsed.Path[i+1:], ".git")
249
} else {
250
return "", fmt.Errorf(tr("invalid git url"))
251
}
0 commit comments