try to fix building with go.work
This commit is contained in:
parent
84cf8265a0
commit
8018774c10
2
argv.go
2
argv.go
|
@ -26,7 +26,7 @@ func (a args) Description() string {
|
|||
go-mod-clean will try to verify your go.* files are using the newest package versions
|
||||
|
||||
* Recreate go.* with 'go mod init' and 'go mod tidy'
|
||||
* Set your required go in go.mod (default is go1.20
|
||||
* Set your required go in go.mod (default is go1.21
|
||||
* Check that the most recent master branch versions are used
|
||||
* Try to trim go.sum of non-existent entries
|
||||
`
|
||||
|
|
|
@ -21,7 +21,7 @@ func eraseGoMod(repo *gitpb.Repo) {
|
|||
|
||||
// sets the required golang version in go.mod
|
||||
func setGoVersion(repo *gitpb.Repo, version string) error {
|
||||
// most things should build with golang after 1.20
|
||||
// most things should build with golang after 1.21
|
||||
if err := repo.StrictRun([]string{"go", "mod", "edit", "-go=" + version}); err != nil {
|
||||
log.Warn(repo.GoPath, "go mod edit failed", err)
|
||||
return err
|
||||
|
@ -41,13 +41,13 @@ func redoGoMod(repo *gitpb.Repo) error {
|
|||
log.Warn("go mod init failed", err)
|
||||
return err
|
||||
}
|
||||
if err := repo.StrictRun([]string{"go", "mod", "tidy"}); err != nil {
|
||||
if err := repo.StrictRun([]string{"go", "mod", "tidy", "-go=1.21"}); err != nil {
|
||||
log.Warn("go mod tidy failed", err)
|
||||
return err
|
||||
}
|
||||
|
||||
// most things should build with golang after 1.20 // todo: allow this to be set somewhere
|
||||
if err := setGoVersion(repo, "1.20"); err != nil {
|
||||
// most things should build with golang after 1.21 // todo: allow this to be set somewhere
|
||||
if err := setGoVersion(repo, "1.21"); err != nil {
|
||||
log.Warn(repo.GoPath, "go mod edit failed", err)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue