Skip to content

Commit 568ca8e

Browse files
committed
ci-test: Fix syntax/formatting check so it actually emits an exit code
The old format didn't emit any exit codes and thus did not cause CI to fail: $ diff -u <(echo -n) <(gofmt -d -s .) make.go:513:46: missing ',' before newline in composite literal $ echo $? 0 The old code would have an failure only if `gofmt` ran successfully AND outputted changes. With the new structure both `gofmt` and `git` needs to pass, thus capturing exit codes and error of any kind of failures.
1 parent 3e594ae commit 568ca8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/ci-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
go-version: ${{ matrix.go-version }}
2424
check-latest: true
2525

26-
- run: diff -u <(echo -n) <(gofmt -d -s .)
26+
- run: gofmt -w -s . && git diff --exit-code --color
2727

2828
- run: go install -v ./...
2929

0 commit comments

Comments
 (0)