Skip to content

Commit

Permalink
ci: prefer go-version-file option for actions/setup-go (#653)
Browse files Browse the repository at this point in the history
In order to automatically align the Go version with the one used in
development, I would suggest to prefer the `go-version-file` option of
the setup action, so the Go version does not need to be managed
manually.


---------

Co-authored-by: Jonas L <[email protected]>
  • Loading branch information
wheinze and jooola authored Dec 21, 2023
1 parent 2d42fcd commit cc675b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: go.mod

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: go.mod

- name: Run gofmt
run: diff -u <(echo -n) <(gofmt -d -s .)
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: go.mod

- name: Run tests
run: go test -coverprofile=coverage.txt -v -race ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: go.mod

- name: Set up gon
run: brew install mitchellh/gon/gon
Expand Down

0 comments on commit cc675b1

Please sign in to comment.