Skip to content

Commit 64d7f1e

Browse files
aykevldeadprogram
authored andcommitted
all: run gofmt on all source code
Some source code wasn't part of `FMT_PATHS` so wasn't checked for correct formatting. This change includes all this source code and excludes cgo/testdata because it contains files that can't be parsed.
1 parent 9af535b commit 64d7f1e

18 files changed

+28
-12
lines changed

.circleci/config.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,21 @@ commands:
9595
key: wasi-libc-sysroot-systemclang-v6
9696
paths:
9797
- lib/wasi-libc/sysroot
98+
- when:
99+
condition: <<parameters.fmt-check>>
100+
steps:
101+
- run:
102+
# Do this before gen-device so that it doesn't check the
103+
# formatting of generated files.
104+
name: Check Go code formatting
105+
command: make fmt-check
98106
- run: make gen-device -j4
99107
- run: make smoketest XTENSA=0
100108
- save_cache:
101109
key: go-cache-v3-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
102110
paths:
103111
- ~/.cache/go-build
104112
- /go/pkg/mod
105-
- when:
106-
condition: <<parameters.fmt-check>>
107-
steps:
108-
- run:
109-
name: Check Go code formatting
110-
command: make fmt-check
111113

112114
jobs:
113115
test-llvm13-go116:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ endif
150150
clean:
151151
@rm -rf build
152152

153-
FMT_PATHS = ./*.go builder cgo compiler interp loader src/device/arm src/examples src/machine src/os src/reflect src/runtime src/sync src/syscall src/testing src/internal/reflectlite transform
153+
FMT_PATHS = ./*.go builder cgo/*.go compiler interp loader src transform
154154
fmt:
155155
@gofmt -l -w $(FMT_PATHS)
156156
fmt-check:

src/crypto/rand/rand_arc4random.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build darwin || tinygo.wasm
12
// +build darwin tinygo.wasm
23

34
// This implementation of crypto/rand uses the arc4random_buf function

src/crypto/rand/rand_urandom.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build linux && !baremetal && !wasi
12
// +build linux,!baremetal,!wasi
23

34
// This implementation of crypto/rand uses the /dev/urandom pseudo-file to

src/device/nxp/mimxrt1062_mpu.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ func enableIcache(enable bool) {
193193
arm.Asm("dsb 0xF")
194194
arm.Asm("isb 0xF")
195195
} else {
196-
arm.Asm("dsb 0xF")
197-
arm.Asm("isb 0xF")
196+
arm.Asm("dsb 0xF")
197+
arm.Asm("isb 0xF")
198198
SystemControl.CCR.ClearBits(SCB_CCR_IC_Msk)
199199
SystemControl.ICIALLU.Set(0)
200-
arm.Asm("dsb 0xF")
201-
arm.Asm("isb 0xF")
200+
arm.Asm("dsb 0xF")
201+
arm.Asm("isb 0xF")
202202
}
203203
}
204204
}

src/internal/fuzz/fuzz.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func CheckCorpus(vals []any, types []reflect.Type) error {
115115
return errors.New("not implemented")
116116
}
117117

118-
func ResetCoverage() {}
118+
func ResetCoverage() {}
119119
func SnapshotCoverage() {}
120120

121121
// RunFuzzWorker is called in a worker process to communicate with the

src/internal/task/task_none.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.none
12
// +build scheduler.none
23

34
package task

src/internal/task/task_stack_386.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && 386
12
// +build scheduler.tasks,386
23

34
package task

src/internal/task/task_stack_amd64.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && amd64 && !windows
12
// +build scheduler.tasks,amd64,!windows
23

34
package task

src/internal/task/task_stack_amd64_windows.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && amd64 && windows
12
// +build scheduler.tasks,amd64,windows
23

34
package task

src/internal/task/task_stack_arm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && arm && !cortexm && !avr && !xtensa && !tinygo.riscv
12
// +build scheduler.tasks,arm,!cortexm,!avr,!xtensa,!tinygo.riscv
23

34
package task

src/internal/task/task_stack_arm64.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && arm64
12
// +build scheduler.tasks,arm64
23

34
package task

src/internal/task/task_stack_avr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && avr
12
// +build scheduler.tasks,avr
23

34
package task

src/internal/task/task_stack_cortexm.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && cortexm
12
// +build scheduler.tasks,cortexm
23

34
package task

src/internal/task/task_stack_esp32.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && esp32
12
// +build scheduler.tasks,esp32
23

34
package task

src/internal/task/task_stack_esp8266.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && esp8266
12
// +build scheduler.tasks,esp8266
23

34
package task

src/internal/task/task_stack_tinygoriscv.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build scheduler.tasks && tinygo.riscv
12
// +build scheduler.tasks,tinygo.riscv
23

34
package task

src/net/interface_tinygo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build tinygo
12
// +build tinygo
23

34
package net

0 commit comments

Comments
 (0)