Skip to content

Commit

Permalink
Only use mod tidy -diff on go 1.23
Browse files Browse the repository at this point in the history
  • Loading branch information
chokoswitch committed Nov 5, 2024
1 parent d90f8fd commit 7c575ad
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions cmd_go122.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build !go1.23

package build

import (
"github.com/goyek/goyek/v2"
)

func goModTidyDiff(a *goyek.A) bool {
a.Log("skipping go mod tidy -diff on < go1.23")
return true
}
12 changes: 12 additions & 0 deletions cmd_go123.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build go1.23

package build

import (
"github.com/goyek/goyek/v2"
"github.com/goyek/x/cmd"
)

func goModTidyDiff(a *goyek.A) bool {
return cmd.Exec(a, "go mod tidy -diff")
}
2 changes: 1 addition & 1 deletion standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func DefineTasks(opts ...Option) {
Parallel: true,
Action: func(a *goyek.A) {
cmd.Exec(a, fmt.Sprintf("go run github.com/golangci/golangci-lint/cmd/golangci-lint@%s run --timeout=20m %s", verGolangCILint, strings.Join(golangciTargets, " ")))
cmd.Exec(a, "go mod tidy -diff")
goModTidyDiff(a)
},
}))
}
Expand Down

0 comments on commit 7c575ad

Please sign in to comment.