Remove input URL scheme

This commit is contained in:
2026-02-12 15:20:59 +08:00
parent dafc545bb6
commit 9d66df6d16

View File

@@ -623,6 +623,9 @@ func mainPack(args []string, usage func()) {
gitRevision = strings.TrimSpace(gitRevision)
gopkg := flagSet.Arg(0)
// Remove URL scheme if present (https://, http://, git://, etc.)
gopkg = strings.TrimPrefix(strings.TrimPrefix(strings.TrimPrefix(gopkg, "https://"), "http://"), "git://")
// Verify that the provided argument is a valid Go package import path
rr, err := vcs.RepoRootForImportPath(gopkg, false)
if err != nil {