From 5e78f0c061d239f23c189a0ff264f86297012ede Mon Sep 17 00:00:00 2001 From: Ivar Derksen Date: Tue, 2 Aug 2022 18:00:26 +0200 Subject: [PATCH 1/2] Fix: gofmt does not return non-zero exit codes on failure --- .github/workflows/status-checks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/status-checks.yml b/.github/workflows/status-checks.yml index b5639bb..a49de3d 100644 --- a/.github/workflows/status-checks.yml +++ b/.github/workflows/status-checks.yml @@ -33,7 +33,8 @@ jobs: go-version: 1.16 - name: Run gofmt - run: gofmt -d -e . + # gofmt does not return non-zero exit codes on failure, so we have to check that there are no issues using grep. + run: gofmt -d -e . | (! grep ^) - name: Run go vet run: go vet ./... From 2223a58af31f26e0b5aa427ae8b379c2c7bc9cbe Mon Sep 17 00:00:00 2001 From: Ivar Derksen Date: Tue, 2 Aug 2022 18:02:27 +0200 Subject: [PATCH 2/2] Improvement: use most recent go version --- .github/workflows/status-checks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/status-checks.yml b/.github/workflows/status-checks.yml index a49de3d..13a2a20 100644 --- a/.github/workflows/status-checks.yml +++ b/.github/workflows/status-checks.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: ^1.16 - name: Build run: go build -v -o uniqueid-issuer-linux-amd64 @@ -30,7 +30,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: ^1.16 - name: Run gofmt # gofmt does not return non-zero exit codes on failure, so we have to check that there are no issues using grep.