From 06b5697fd359c4c4c25718eefe71404a43b67548 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Tue, 6 Apr 2021 07:54:39 +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 ./...