Skip to content

Commit a2f9374

Browse files
authored
improve Go workflow checks (#8)
* download Go dependencies before Bonk runs * check modernize in CI * apply modernize rewrites * fix linux modernize rewrite
1 parent a32ea3a commit a2f9374

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/bonk.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
with:
3232
go-version-file: go.mod
3333

34+
- name: Download Go dependencies
35+
run: go mod download
36+
3437
- name: Run Bonk
3538
uses: ask-bonk/ask-bonk/github@main
3639
env:

.github/workflows/build-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ jobs:
2020
with:
2121
go-version-file: go.mod
2222

23+
- name: Check modernize
24+
run: |
25+
go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@latest -fix ./...
26+
git diff --exit-code
27+
2328
- name: Build
2429
run: go build ./cmd/artifact-fs
2530

internal/daemon/mount_check_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func isMounted(path string) bool {
1414
if err != nil {
1515
return false
1616
}
17-
for _, line := range strings.Split(string(out), "\n") {
17+
for line := range strings.SplitSeq(string(out), "\n") {
1818
if strings.Contains(line, " on "+path+" (") || strings.Contains(line, " on /private"+path+" (") {
1919
return true
2020
}

0 commit comments

Comments
 (0)