Browse Source

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.
pull/2921/head
Ayke van Laethem 2 years ago
committed by Ron Evans
parent
commit
64d7f1e436
  1. 14
      .circleci/config.yml
  2. 2
      Makefile
  3. 1
      src/crypto/rand/rand_arc4random.go
  4. 1
      src/crypto/rand/rand_urandom.go
  5. 8
      src/device/nxp/mimxrt1062_mpu.go
  6. 2
      src/internal/fuzz/fuzz.go
  7. 1
      src/internal/task/task_none.go
  8. 1
      src/internal/task/task_stack_386.go
  9. 1
      src/internal/task/task_stack_amd64.go
  10. 1
      src/internal/task/task_stack_amd64_windows.go
  11. 1
      src/internal/task/task_stack_arm.go
  12. 1
      src/internal/task/task_stack_arm64.go
  13. 1
      src/internal/task/task_stack_avr.go
  14. 1
      src/internal/task/task_stack_cortexm.go
  15. 1
      src/internal/task/task_stack_esp32.go
  16. 1
      src/internal/task/task_stack_esp8266.go
  17. 1
      src/internal/task/task_stack_tinygoriscv.go
  18. 1
      src/net/interface_tinygo.go

14
.circleci/config.yml

@ -95,6 +95,14 @@ commands:
key: wasi-libc-sysroot-systemclang-v6
paths:
- lib/wasi-libc/sysroot
- when:
condition: <<parameters.fmt-check>>
steps:
- run:
# Do this before gen-device so that it doesn't check the
# formatting of generated files.
name: Check Go code formatting
command: make fmt-check
- run: make gen-device -j4
- run: make smoketest XTENSA=0
- save_cache:
@ -102,12 +110,6 @@ commands:
paths:
- ~/.cache/go-build
- /go/pkg/mod
- when:
condition: <<parameters.fmt-check>>
steps:
- run:
name: Check Go code formatting
command: make fmt-check
jobs:
test-llvm13-go116:

2
Makefile

@ -150,7 +150,7 @@ endif
clean:
@rm -rf build
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
FMT_PATHS = ./*.go builder cgo/*.go compiler interp loader src transform
fmt:
@gofmt -l -w $(FMT_PATHS)
fmt-check:

1
src/crypto/rand/rand_arc4random.go

@ -1,3 +1,4 @@
//go:build darwin || tinygo.wasm
// +build darwin tinygo.wasm
// This implementation of crypto/rand uses the arc4random_buf function

1
src/crypto/rand/rand_urandom.go

@ -1,3 +1,4 @@
//go:build linux && !baremetal && !wasi
// +build linux,!baremetal,!wasi
// This implementation of crypto/rand uses the /dev/urandom pseudo-file to

8
src/device/nxp/mimxrt1062_mpu.go

@ -193,12 +193,12 @@ func enableIcache(enable bool) {
arm.Asm("dsb 0xF")
arm.Asm("isb 0xF")
} else {
arm.Asm("dsb 0xF")
arm.Asm("isb 0xF")
arm.Asm("dsb 0xF")
arm.Asm("isb 0xF")
SystemControl.CCR.ClearBits(SCB_CCR_IC_Msk)
SystemControl.ICIALLU.Set(0)
arm.Asm("dsb 0xF")
arm.Asm("isb 0xF")
arm.Asm("dsb 0xF")
arm.Asm("isb 0xF")
}
}
}

2
src/internal/fuzz/fuzz.go

@ -115,7 +115,7 @@ func CheckCorpus(vals []any, types []reflect.Type) error {
return errors.New("not implemented")
}
func ResetCoverage() {}
func ResetCoverage() {}
func SnapshotCoverage() {}
// RunFuzzWorker is called in a worker process to communicate with the

1
src/internal/task/task_none.go

@ -1,3 +1,4 @@
//go:build scheduler.none
// +build scheduler.none
package task

1
src/internal/task/task_stack_386.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && 386
// +build scheduler.tasks,386
package task

1
src/internal/task/task_stack_amd64.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && amd64 && !windows
// +build scheduler.tasks,amd64,!windows
package task

1
src/internal/task/task_stack_amd64_windows.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && amd64 && windows
// +build scheduler.tasks,amd64,windows
package task

1
src/internal/task/task_stack_arm.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && arm && !cortexm && !avr && !xtensa && !tinygo.riscv
// +build scheduler.tasks,arm,!cortexm,!avr,!xtensa,!tinygo.riscv
package task

1
src/internal/task/task_stack_arm64.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && arm64
// +build scheduler.tasks,arm64
package task

1
src/internal/task/task_stack_avr.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && avr
// +build scheduler.tasks,avr
package task

1
src/internal/task/task_stack_cortexm.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && cortexm
// +build scheduler.tasks,cortexm
package task

1
src/internal/task/task_stack_esp32.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && esp32
// +build scheduler.tasks,esp32
package task

1
src/internal/task/task_stack_esp8266.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && esp8266
// +build scheduler.tasks,esp8266
package task

1
src/internal/task/task_stack_tinygoriscv.go

@ -1,3 +1,4 @@
//go:build scheduler.tasks && tinygo.riscv
// +build scheduler.tasks,tinygo.riscv
package task

1
src/net/interface_tinygo.go

@ -1,3 +1,4 @@
//go:build tinygo
// +build tinygo
package net

Loading…
Cancel
Save