diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e2f3bcd..88d0aea 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -38,7 +38,11 @@ jobs: run: go test -v -covermode atomic -coverprofile=covprofile ./... - name: Gofmt - run: gofmt -d ./ + # Run gofmt, print the output and exit with status code 1 if it isn't empty. + run: | + OUTPUT=$(gofmt -d ./) + echo "$OUTPUT" + test -z "$OUTPUT" - name: Send coverage if: ${{ matrix.go-version == 'stable' && github.ref == 'refs/heads/master' }}