From 02849956e80e3501a86930c61bd305b6025a79dc Mon Sep 17 00:00:00 2001 From: istarboy Date: Thu, 18 Nov 2021 11:23:51 +0800 Subject: [PATCH 1/3] add ci gofmt check notice --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d4ca188d2..321dae338 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -57,7 +57,8 @@ jobs: run: | date find . -name "*.go" | xargs gofmt -w - git diff --name-only --exit-code || exit 1 + git diff --name-only --exit-code + if [ $? != 0 ];then echo "Notice: gofmt check failed,please gofmt before pr." && exit 1; else echo "gofmt check pass."; fi sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts - name: Run i386 Arch Test From 95472779315fce471c30bc8ab8321eb0e08d15c8 Mon Sep 17 00:00:00 2001 From: istarboy Date: Thu, 18 Nov 2021 11:32:03 +0800 Subject: [PATCH 2/3] fix gofmt check cmd --- .github/workflows/go.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 321dae338..5844ae3f3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -57,8 +57,7 @@ jobs: run: | date find . -name "*.go" | xargs gofmt -w - git diff --name-only --exit-code - if [ $? != 0 ];then echo "Notice: gofmt check failed,please gofmt before pr." && exit 1; else echo "gofmt check pass."; fi + git diff --name-only --exit-code || if [ $? != 0 ];then echo "Notice: gofmt check failed,please gofmt before pr." && exit 1; else echo "gofmt check pass."; fi sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts - name: Run i386 Arch Test From 0d8c9d5cfbef86cac91e5da2ad4983f74a997184 Mon Sep 17 00:00:00 2001 From: istarboy Date: Thu, 18 Nov 2021 11:56:03 +0800 Subject: [PATCH 3/3] move "gofmt check pass" echo --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5844ae3f3..781d0ff0c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -57,7 +57,8 @@ jobs: run: | date find . -name "*.go" | xargs gofmt -w - git diff --name-only --exit-code || if [ $? != 0 ];then echo "Notice: gofmt check failed,please gofmt before pr." && exit 1; else echo "gofmt check pass."; fi + git diff --name-only --exit-code || if [ $? != 0 ];then echo "Notice: gofmt check failed,please gofmt before pr." && exit 1; fi + echo "gofmt check pass." sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts - name: Run i386 Arch Test