From 22c6169f00d050c25c8183e1dc6729a67aeccd82 Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Tue, 1 Mar 2022 20:28:19 +0000 Subject: [PATCH 1/2] [BEAM-14012] Add go fmt to Github Actions --- .github/workflows/go_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/go_tests.yml b/.github/workflows/go_tests.yml index f58bfcc8a8a3..fe2565395dd7 100644 --- a/.github/workflows/go_tests.yml +++ b/.github/workflows/go_tests.yml @@ -49,5 +49,7 @@ jobs: flags: go files: ./sdks/go/pkg/coverage.txt name: go-unittests + - name: Run fmt + run: cd sdks/go/pkg/beam && go fmt ./...; git diff-index --quiet HEAD || (echo "Run go fmt before checking in changes" && exit 1) - name: Run vet run: cd sdks/go/pkg/beam && go vet --copylocks=false --unsafeptr=false ./... From 7f4e7857dfbd7dbe9a24549e33f86e82c5a85386 Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Tue, 1 Mar 2022 20:37:05 +0000 Subject: [PATCH 2/2] Add fail logic to vet check too --- .github/workflows/go_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go_tests.yml b/.github/workflows/go_tests.yml index fe2565395dd7..b70ec8141049 100644 --- a/.github/workflows/go_tests.yml +++ b/.github/workflows/go_tests.yml @@ -52,4 +52,4 @@ jobs: - name: Run fmt run: cd sdks/go/pkg/beam && go fmt ./...; git diff-index --quiet HEAD || (echo "Run go fmt before checking in changes" && exit 1) - name: Run vet - run: cd sdks/go/pkg/beam && go vet --copylocks=false --unsafeptr=false ./... + run: cd sdks/go/pkg/beam && go vet --copylocks=false --unsafeptr=false ./... || (echo "Run go vet and fix warnings before checking in changes" && exit 1)