update go ver #131
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: [pull_request,push] | |
jobs: | |
test: | |
name: Test and Fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v2 | |
name: Setup go | |
with: | |
go-version: 1.23 | |
- uses: actions/checkout@v2 | |
name: Checkout code | |
- name: Cache Go Modules | |
id: cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Download Go Modules | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: go mod download | |
- name: Install goimports | |
run: go install golang.org/x/tools/cmd/goimports@latest | |
- name: fmt | |
run: if [[ $(goimports -l $(find . -name "*.go")) ]]; then echo "Please fix your go files formatting (goimports -w \$(find . -name \"*.go\"))"; exit 1; fi | |
- name: Test | |
run: go test -v ./... |