Skip to content

Commit 18db73d

Browse files
committed
metadata: trim .git suffix when searching gtihub URL for gopkg
Some go hosts have this suffix in their go-import metadata which broke fetching the repo metadat from GitHub's API, e.g. go.bug.st: Could not determine description for "go.bug.st/cleanup": GET https://api.github.com/repos/bugst/go-cleanup.git: 404 Not Found [] Could not determine long description for "go.bug.st/cleanup": get readme: GET https://api.github.com/repos/bugst/go-cleanup.git/readme: 404 Not Found [] Could not determine license for "go.bug.st/cleanup": get license for Go package: GET https://api.github.com/repos/bugst/go-cleanup.git/license: 404 Not Found [] Could not determine copyright for "go.bug.st/cleanup": get repo: GET https://api.github.com/repos/bugst/go-cleanup.git: 404 Not Found []
1 parent c49bae1 commit 18db73d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func findGitHubOwnerRepo(gopkg string) (string, error) {
112112
return ""
113113
}
114114
if repoMatch := githubRegexp.FindStringSubmatch(f[2]); repoMatch != nil {
115-
return repoMatch[1]
115+
return strings.TrimSuffix(repoMatch[1], ".git")
116116
}
117117
}
118118
return ""

0 commit comments

Comments
 (0)