Skip to content

Commit 1bb8467

Browse files
committed
fix: make CI gofmt check portable
1 parent 853ddd6 commit 1bb8467

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
- name: gofmt check
2727
shell: bash
2828
run: |
29-
mapfile -t files < <(git ls-files '*.go')
30-
if [ "${#files[@]}" -eq 0 ]; then
29+
files="$(git ls-files '*.go')"
30+
if [ -z "$files" ]; then
3131
exit 0
3232
fi
33-
out="$(gofmt -l "${files[@]}")"
33+
out="$(printf '%s\n' "$files" | xargs gofmt -l)"
3434
if [ -n "$out" ]; then
3535
printf '%s\n' "$out"
3636
exit 1

0 commit comments

Comments
 (0)