Skip to content

Commit 258df65

Browse files
authored
Merge pull request #17 from xmudrii/fix-go-mod-edit
Fix go mod edit commands in sync-tags
2 parents a2772f5 + 94d8859 commit 258df65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/sync-tags/gomod.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ func updateGomodWithTaggedDependencies(searchTag string, depsRepo []string, semv
121121
return changed, fmt.Errorf("failed to package %s dependency: %w", depPkg, err)
122122
}
123123

124+
if moduleMajor >= 2 {
125+
depPkg = fmt.Sprintf("%s/v%d", depPkg, moduleMajor)
126+
}
127+
124128
requireCommand := exec.Command("go", "mod", "edit", "-fmt", "-require", fmt.Sprintf("%s@%s", depPkg, pseudoVersionOrTag))
125129
requireCommand.Env = append(os.Environ(), "GO111MODULE=on")
126130
requireCommand.Stdout = os.Stdout

0 commit comments

Comments
 (0)