2019-12-12 04:31:35 +01:00
|
|
|
name: gofmt
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
2020-03-02 22:21:19 +01:00
|
|
|
paths:
|
|
|
|
- '.github/workflows/gofmt.yml'
|
|
|
|
- '**.go'
|
2019-12-12 04:31:35 +01:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
gofmt:
|
|
|
|
name: Run gofmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
2020-02-27 21:48:39 +01:00
|
|
|
- name: Set up Go 1.14
|
2019-12-12 04:31:35 +01:00
|
|
|
uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-02-27 21:48:39 +01:00
|
|
|
go-version: 1.14
|
2019-12-12 04:31:35 +01:00
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- name: gofmt
|
|
|
|
run: |
|
|
|
|
if [ "$(find . -iname '*.go' | xargs gofmt -l)" ]
|
|
|
|
then
|
|
|
|
find . -iname '*.go' | xargs gofmt -d
|
|
|
|
exit 1
|
|
|
|
fi
|