From ee91b058a63c87b73489e96c51c5bc48b06d1687 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Fri, 2 Apr 2021 07:33:40 +0000 Subject: [PATCH] update .github/workflows/go-check.yml --- .github/workflows/go-check.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index a7db382..8124473 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -21,6 +21,14 @@ jobs: go mod tidy diff go.mod go.mod.orig diff go.sum go.sum.orig + - name: gofmt + if: ${{ success() || failure() }} # run this step even if the previous one failed + run: | + out=$(gofmt -s -l .) + if [[ -n "$out" ]]; then + echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}' + exit 1 + fi - name: go vet if: ${{ success() || failure() }} # run this step even if the previous one failed run: go vet ./...