forked from mirror/jwt
Add Go code formatting
This commit is contained in:
parent
d272f4dadc
commit
1697222a72
|
@ -1,21 +0,0 @@
|
||||||
name: gofumpt
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prettier:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
ref: ${{ github.head_ref }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Auto Format code
|
|
||||||
uses: iamnotaturtle/auto-gofmt@v2.0.0
|
|
||||||
with:
|
|
||||||
only_changed: true
|
|
|
@ -33,6 +33,13 @@ jobs:
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: "${{ matrix.go }}"
|
go-version: "${{ matrix.go }}"
|
||||||
|
- name: Check Go code formatting
|
||||||
|
run: |
|
||||||
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
||||||
|
gofmt -s -l .
|
||||||
|
echo "Please format Go code by running: go fmt ./..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
go vet ./...
|
go vet ./...
|
||||||
|
|
Loading…
Reference in New Issue