|
@@ -14,10 +14,10 @@ jobs:
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
|
|
|
- - name: Set up Go 1.19
|
|
|
+ - name: Set up Go 1.20
|
|
|
uses: actions/setup-go@v2
|
|
|
with:
|
|
|
- go-version: 1.19
|
|
|
+ go-version: "1.20"
|
|
|
id: go
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
@@ -26,19 +26,18 @@ jobs:
|
|
|
- uses: actions/cache@v2
|
|
|
with:
|
|
|
path: ~/go/pkg/mod
|
|
|
- key: ${{ runner.os }}-gofmt1.19-${{ hashFiles('**/go.sum') }}
|
|
|
+ key: ${{ runner.os }}-gofmt1.20-${{ hashFiles('**/go.sum') }}
|
|
|
restore-keys: |
|
|
|
- ${{ runner.os }}-gofmt1.19-
|
|
|
+ ${{ runner.os }}-gofmt1.20-
|
|
|
|
|
|
- name: Install goimports
|
|
|
run: |
|
|
|
- go get golang.org/x/tools/cmd/goimports
|
|
|
- go build golang.org/x/tools/cmd/goimports
|
|
|
+ go install golang.org/x/tools/cmd/goimports@latest
|
|
|
|
|
|
- name: gofmt
|
|
|
run: |
|
|
|
- if [ "$(find . -iname '*.go' | grep -v '\.pb\.go$' | xargs ./goimports -l)" ]
|
|
|
+ if [ "$(find . -iname '*.go' | grep -v '\.pb\.go$' | xargs goimports -l)" ]
|
|
|
then
|
|
|
- find . -iname '*.go' | grep -v '\.pb\.go$' | xargs ./goimports -d
|
|
|
+ find . -iname '*.go' | grep -v '\.pb\.go$' | xargs goimports -d
|
|
|
exit 1
|
|
|
fi
|