From 7aca3e10a1063f3f0a0db229f2e1df9da7fb8264 Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Sun, 30 Oct 2022 20:02:26 +0100 Subject: [PATCH] Add go to path instead of GO_BIN --- hack/gofmt_check.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/gofmt_check.sh b/hack/gofmt_check.sh index 8b51df63..dec5f47d 100755 --- a/hack/gofmt_check.sh +++ b/hack/gofmt_check.sh @@ -6,11 +6,11 @@ source hack/bazel_setup.sh $BAZEL_B @go_sdk//... -GO_BIN="$(bazel info output_base)/external/go_sdk/bin/go" +export PATH="$(bazel info output_base)/external/go_sdk/bin:$PATH" -if [[ -n $($GO_BIN fmt -n $(go list ./... | grep -v /vendor/) | sed 's/ -w//') ]]; then +if [[ -z $(go fmt -n $(go list ./... | grep -v /vendor/) | sed 's/ -w//') ]]; then echo "Go files must be formatted with gofmt. Please run:" - echo " go fmt $(go list ./... | grep -v /vendor/)" + echo ' go fmt $(go list ./... | grep -v /vendor/)' exit 1 fi