diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 218019224b..589eb71fe6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -115,6 +115,8 @@ jobs: gem install --no-document fpm - name: Run linter run: make lint + - name: Run spellcheck + run: make spell - name: Build TinyGo release run: | make release deb -j3 STATIC=1 diff --git a/GNUmakefile b/GNUmakefile index a27489cc26..504e1561af 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -949,20 +949,25 @@ endif .PHONY: tools tools: - go generate -C ./internal/tools -tags tools ./ + cd internal/tools && go generate -tags tools ./ .PHONY: lint -lint: ## Lint source tree - go run github.com/mgechev/revive -version +lint: tools ## Lint source tree + revive -version # TODO: lint more directories! # revive.toml isn't flexible enough to filter out just one kind of error from a checker, so do it with grep here. # Can't use grep with friendly formatter. Plain output isn't too bad, though. # Use 'grep .' to get rid of stray blank line - go run github.com/mgechev/revive -config revive.toml compiler/... src/{os,reflect}/*.go | grep -v "should have comment or be unexported" | grep '.' | awk '{print}; END {exit NR>0}' + revive -config revive.toml compiler/... src/{os,reflect}/*.go | grep -v "should have comment or be unexported" | grep '.' | awk '{print}; END {exit NR>0}' +SPELLDIRSCMD=find . -depth 1 -type d | egrep -wv '.git|lib|llvm|src'; find src -depth 1 | egrep -wv 'device|internal|net|vendor'; find src/internal -depth 1 -type d | egrep -wv src/internal/wasi .PHONY: spell -spell: ## Spellcheck source tree - go run github.com/client9/misspell/cmd/misspell -i 'ackward,devided,extint,inbetween,programmmer,rela' $$( find . -depth 1 -type d | egrep -w -v 'lib|llvm|src/net' ) +spell: tools ## Spellcheck source tree + misspell -error --dict misspell.csv -i 'ackward,devided,extint,rela' $$( $(SPELLDIRSCMD) ) + +.PHONY: spellfix +spellfix: tools ## Same as spell, but fixes what it finds + misspell -w --dict misspell.csv -i 'ackward,devided,extint,rela' $$( $(SPELLDIRSCMD) ) # https://www.client9.com/self-documenting-makefiles/ .PHONY: help diff --git a/builder/ar.go b/builder/ar.go index 578b88ba57..807595b792 100644 --- a/builder/ar.go +++ b/builder/ar.go @@ -16,7 +16,7 @@ import ( "github.com/blakesmith/ar" ) -// makeArchive creates an arcive for static linking from a list of object files +// makeArchive creates an archive for static linking from a list of object files // given as a parameter. It is equivalent to the following command: // // ar -rcs diff --git a/builder/cc1as.h b/builder/cc1as.h index 4b22fc3e81..67b97f6cf9 100644 --- a/builder/cc1as.h +++ b/builder/cc1as.h @@ -93,7 +93,7 @@ struct AssemblerInvocation { EmitDwarfUnwindType EmitDwarfUnwind; // Whether to emit compact-unwind for non-canonical entries. - // Note: maybe overriden by other constraints. + // Note: maybe overridden by other constraints. unsigned EmitCompactUnwindNonCanonical : 1; /// The name of the relocation model to use. diff --git a/builder/tools.go b/builder/tools.go index e1c6443c65..bd18aa09d2 100644 --- a/builder/tools.go +++ b/builder/tools.go @@ -49,7 +49,7 @@ func link(linker string, flags ...string) error { err := cmd.Run() if err != nil { if buf.Len() == 0 { - // The linker failed but ther was no output. + // The linker failed but there was no output. // Therefore, show some output anyway. return fmt.Errorf("failed to run linker: %w", err) } diff --git a/compileopts/config.go b/compileopts/config.go index 67c773de16..eca037503c 100644 --- a/compileopts/config.go +++ b/compileopts/config.go @@ -60,7 +60,7 @@ func (c *Config) GOOS() string { } // GOARCH returns the GOARCH of the target. This might not always be the actual -// archtecture: for example, the AVR target is not supported by the Go standard +// architecture: for example, the AVR target is not supported by the Go standard // library so such targets will usually pretend to be linux/arm. func (c *Config) GOARCH() string { return c.Target.GOARCH @@ -461,7 +461,7 @@ func (c *Config) BinaryFormat(ext string) string { // Programmer returns the flash method and OpenOCD interface name given a // particular configuration. It may either be all configured in the target JSON -// file or be modified using the -programmmer command-line option. +// file or be modified using the -programmer command-line option. func (c *Config) Programmer() (method, openocdInterface string) { switch c.Options.Programmer { case "": diff --git a/compiler/asserts.go b/compiler/asserts.go index 035fda6160..f07b73bc26 100644 --- a/compiler/asserts.go +++ b/compiler/asserts.go @@ -99,7 +99,7 @@ func (b *builder) createUnsafeSliceStringCheck(name string, ptr, len llvm.Value, // However, in practice, it is also necessary to check that the length is // not too big that a GEP wouldn't be possible without wrapping the pointer. // These two checks (non-negative and not too big) can be merged into one - // using an unsiged greater than. + // using an unsigned greater than. // Make sure the len value is at least as big as a uintptr. len = b.extendInteger(len, lenType, b.uintptrType) diff --git a/compiler/compiler.go b/compiler/compiler.go index e9697fae27..bc17250d99 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -242,7 +242,7 @@ func NewTargetMachine(config *Config) (llvm.TargetMachine, error) { } // Sizes returns a types.Sizes appropriate for the given target machine. It -// includes the correct int size and aligment as is necessary for the Go +// includes the correct int size and alignment as is necessary for the Go // typechecker. func Sizes(machine llvm.TargetMachine) types.Sizes { targetData := machine.CreateTargetData() diff --git a/compiler/gc.go b/compiler/gc.go index 9d568a174b..fc0e6e687f 100644 --- a/compiler/gc.go +++ b/compiler/gc.go @@ -78,7 +78,7 @@ func (b *builder) trackValue(value llvm.Value) { } } -// trackPointer creates a call to runtime.trackPointer, bitcasting the poitner +// trackPointer creates a call to runtime.trackPointer, bitcasting the pointer // first if needed. The input value must be of LLVM pointer type. func (b *builder) trackPointer(value llvm.Value) { b.createRuntimeCall("trackPointer", []llvm.Value{value, b.stackChainAlloca}, "") diff --git a/compiler/interface.go b/compiler/interface.go index fc698c7a97..dffaeec0ad 100644 --- a/compiler/interface.go +++ b/compiler/interface.go @@ -86,7 +86,7 @@ func (b *builder) createMakeInterface(val llvm.Value, typ types.Type, pos token. // extractValueFromInterface extract the value from an interface value // (runtime._interface) under the assumption that it is of the type given in -// llvmType. The behavior is undefied if the interface is nil or llvmType +// llvmType. The behavior is undefined if the interface is nil or llvmType // doesn't match the underlying type of the interface. func (b *builder) extractValueFromInterface(itf llvm.Value, llvmType llvm.Type) llvm.Value { valuePtr := b.CreateExtractValue(itf, 1, "typeassert.value.ptr") diff --git a/compiler/llvm.go b/compiler/llvm.go index bdbf0ece16..59aaee8fdd 100644 --- a/compiler/llvm.go +++ b/compiler/llvm.go @@ -419,7 +419,7 @@ func (c *compilerContext) getPointerBitmap(typ llvm.Type, pos token.Pos) *big.In } } -// archFamily returns the archtecture from the LLVM triple but with some +// archFamily returns the architecture from the LLVM triple but with some // architecture names ("armv6", "thumbv7m", etc) merged into a single // architecture name ("arm"). func (c *compilerContext) archFamily() string { diff --git a/compiler/llvmutil/llvm.go b/compiler/llvmutil/llvm.go index 48fddffbe5..607e91e8d8 100644 --- a/compiler/llvmutil/llvm.go +++ b/compiler/llvmutil/llvm.go @@ -207,7 +207,7 @@ func AppendToGlobal(mod llvm.Module, globalName string, values ...llvm.Value) { used.SetLinkage(llvm.AppendingLinkage) } -// Return the LLVM major version. +// Version returns the LLVM major version. func Version() int { majorStr := strings.Split(llvm.Version, ".")[0] major, err := strconv.Atoi(majorStr) diff --git a/compiler/map.go b/compiler/map.go index 1c124c2b20..b4c5267233 100644 --- a/compiler/map.go +++ b/compiler/map.go @@ -326,7 +326,7 @@ func (b *builder) zeroUndefBytes(llvmType llvm.Type, ptr llvm.Value) error { if i < numFields-1 { nextOffset = b.targetData.ElementOffset(llvmStructType, i+1) } else { - // Last field? Next offset is the total size of the allcoate struct. + // Last field? Next offset is the total size of the allocate struct. nextOffset = b.targetData.TypeAllocSize(llvmStructType) } diff --git a/compiler/syscall.go b/compiler/syscall.go index d9d21c3cf5..d878df0270 100644 --- a/compiler/syscall.go +++ b/compiler/syscall.go @@ -145,7 +145,7 @@ func (b *builder) createRawSyscall(call *ssa.CallCommon) (llvm.Value, error) { // Also useful: // https://web.archive.org/web/20220529105937/https://www.linux-mips.org/wiki/Syscall // The syscall number goes in r2, the result also in r2. - // Register r7 is both an input paramter and an output parameter: if it + // Register r7 is both an input parameter and an output parameter: if it // is non-zero, the system call failed and r2 is the error code. // The code below implements the O32 syscall ABI, not the N32 ABI. It // could implement both at the same time if needed (like what appears to diff --git a/diagnostics/diagnostics.go b/diagnostics/diagnostics.go index e58becfb8a..1e363580a9 100644 --- a/diagnostics/diagnostics.go +++ b/diagnostics/diagnostics.go @@ -43,7 +43,7 @@ func CreateDiagnostics(err error) ProgramDiagnostic { if err == nil { return nil } - // Right now, the compiler will only show errors for the first pacakge that + // Right now, the compiler will only show errors for the first package that // fails to build. This is likely to change in the future. return ProgramDiagnostic{ createPackageDiagnostic(err), @@ -147,7 +147,7 @@ func createDiagnostics(err error) []Diagnostic { // last package fmt.Fprintln(buf, "\timports", pkgPath+": "+err.Err.Error()) } else { - // not the last pacakge + // not the last package fmt.Fprintln(buf, "\timports", pkgPath) } } diff --git a/go.mod b/go.mod index b054e77b63..bf85ef3ad1 100644 --- a/go.mod +++ b/go.mod @@ -7,14 +7,12 @@ require ( github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 github.com/chromedp/cdproto v0.0.0-20220113222801-0725d94bb6ee github.com/chromedp/chromedp v0.7.6 - github.com/client9/misspell v0.3.4 github.com/gofrs/flock v0.8.1 github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf github.com/marcinbor85/gohex v0.0.0-20200531091804-343a4b548892 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-tty v0.0.4 - github.com/mgechev/revive v1.3.7 github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 go.bug.st/serial v1.6.0 golang.org/x/net v0.26.0 @@ -25,23 +23,14 @@ require ( ) require ( - github.com/BurntSushi/toml v1.3.2 // indirect - github.com/chavacava/garif v0.1.0 // indirect github.com/chromedp/sysutil v1.0.0 // indirect github.com/creack/goselect v0.1.2 // indirect - github.com/fatih/color v1.16.0 // indirect - github.com/fatih/structtag v1.2.0 // indirect github.com/gobwas/httphead v0.1.0 // indirect github.com/gobwas/pool v0.2.1 // indirect github.com/gobwas/ws v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect - github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/spf13/afero v1.11.0 // indirect + github.com/stretchr/testify v1.8.4 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/go.sum b/go.sum index 8d6dc516ca..7a6d1f4a97 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,7 @@ -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/aykevl/go-wasm v0.0.2-0.20240312204833-50275154210c h1:4T0Vj1UkGgcpkRrmn7SbokebnlfxJcMZPgWtOYACAAA= github.com/aykevl/go-wasm v0.0.2-0.20240312204833-50275154210c/go.mod h1:7sXyiaA0WtSogCu67R2252fQpVmJMh9JWJ9ddtGkpWw= github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 h1:oMCHnXa6CCCafdPDbMh/lWRhRByN0VFLvv+g+ayx1SI= github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= -github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= -github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/chromedp/cdproto v0.0.0-20211126220118-81fa0469ad77/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= github.com/chromedp/cdproto v0.0.0-20220113222801-0725d94bb6ee h1:+SFdIVfQpG0s0DHYzou0kgfE0n0ZjKPwbiRJsXrZegU= github.com/chromedp/cdproto v0.0.0-20220113222801-0725d94bb6ee/go.mod h1:At5TxYYdxkbQL0TSefRjhLE3Q0lgvqKKMSFUglJ7i1U= @@ -13,17 +9,10 @@ github.com/chromedp/chromedp v0.7.6 h1:2juGaktzjwULlsn+DnvIZXFUckEp5xs+GOBroaea+ github.com/chromedp/chromedp v0.7.6/go.mod h1:ayT4YU/MGAALNfOg9gNrpGSAdnU51PMx+FCeuT1iXzo= github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3Ic= github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0= github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= @@ -51,41 +40,24 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-tty v0.0.4 h1:NVikla9X8MN0SQAqCYzpGyXv0jY7MNl3HOWD2dkle7E= github.com/mattn/go-tty v0.0.4/go.mod h1:u5GGXBtZU6RQoKV8gY5W6UhMudbR5vXnUe7j3pxse28= -github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= -github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE= -github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5 h1:1SoBaSPudixRecmlHXb/GxmaD3fLMtHIDN13QujwQuc= github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3 h1:aQKxg3+2p+IFXXg97McgDGT5zcMrQoi0EICZs8Pgchs= github.com/sigurn/crc16 v0.0.0-20211026045750-20ab5afb07e3/go.mod h1:9/etS5gpQq9BJsJMWg1wpLbfuSnkm8dPF6FdW2JXVhA= -github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= -github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= go.bug.st/serial v1.6.0 h1:mAbRGN4cKE2J5gMwsMHC2KQisdLRQssO9WSM+rbZJ8A= go.bug.st/serial v1.6.0/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= +golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -103,7 +75,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= tinygo.org/x/go-llvm v0.0.0-20240627184919-3b50c76783a8 h1:bLsZXRUBavt++CJlMN7sppNziqu3LyamESLhFJcpqFQ= diff --git a/internal/tools/go.mod b/internal/tools/go.mod new file mode 100644 index 0000000000..854c93fc0a --- /dev/null +++ b/internal/tools/go.mod @@ -0,0 +1,30 @@ +// TODO: remove this (by merging it into the top-level go.mod) +// once the top level go.mod specifies a go new enough to make our version of misspell happy. + +module tools + +go 1.21 + +require ( + github.com/golangci/misspell v0.6.0 + github.com/mgechev/revive v1.3.9 +) + +require ( + github.com/BurntSushi/toml v1.4.0 // indirect + github.com/chavacava/garif v0.1.0 // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/fatih/structtag v1.2.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spf13/afero v1.11.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.23.0 // indirect +) diff --git a/internal/tools/go.sum b/internal/tools/go.sum new file mode 100644 index 0000000000..dea0fb1f9c --- /dev/null +++ b/internal/tools/go.sum @@ -0,0 +1,56 @@ +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= +github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 h1:zpIH83+oKzcpryru8ceC6BxnoG8TBrhgAvRg8obzup0= +github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= +github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= +github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index d592921a54..0cbb56edf7 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -5,9 +5,9 @@ package tools import ( - _ "github.com/client9/misspell" + _ "github.com/golangci/misspell" _ "github.com/mgechev/revive" ) -//go:generate go install github.com/client9/misspell/cmd/misspell +//go:generate go install github.com/golangci/misspell/cmd/misspell //go:generate go install github.com/mgechev/revive diff --git a/interp/README.md b/interp/README.md index c0a794cc75..26ab657c0c 100644 --- a/interp/README.md +++ b/interp/README.md @@ -28,7 +28,7 @@ All in all, this design provides several benefits: it should be a whole lot faster for loops as it doesn't have to call into LLVM (via CGo) for every operation. -As mentioned, this partial evaulator comes in three parts: a compiler, an +As mentioned, this partial evaluator comes in three parts: a compiler, an interpreter, and a memory manager. ## Compiler diff --git a/misspell.csv b/misspell.csv new file mode 100644 index 0000000000..7d247aea1d --- /dev/null +++ b/misspell.csv @@ -0,0 +1,22 @@ +acuire, acquire +adust, adjust +allcoate, allocate +archtecture, architecture +arcive, archive +configration, configuration +contants, constants +cricital, critical +evaulator, evaluator +freqency, frequency +frquency, frequency +implmented, implemented +interrput, interrupt +interrut, interrupt +poitner, pointer +probbably, probably +refection, reflection +satisifying, satisfying +simulataneously, simultaneously +suggets, suggests +undefied, undefined +unsiged, unsigned diff --git a/src/crypto/rand/rand_arc4random.go b/src/crypto/rand/rand_arc4random.go index 64a6218bd9..ada1a96192 100644 --- a/src/crypto/rand/rand_arc4random.go +++ b/src/crypto/rand/rand_arc4random.go @@ -3,7 +3,7 @@ // This implementation of crypto/rand uses the arc4random_buf function // (available on both MacOS and WASI) to generate random numbers. // -// Note: arc4random_buf (unlike what the name suggets) does not use the insecure +// Note: arc4random_buf (unlike what the name suggests) does not use the insecure // RC4 cipher. Instead, it uses a high-quality cipher, varying by the libc // implementation. diff --git a/src/crypto/tls/tls.go b/src/crypto/tls/tls.go index 75f4a25093..1520c30fca 100644 --- a/src/crypto/tls/tls.go +++ b/src/crypto/tls/tls.go @@ -101,7 +101,7 @@ type Dialer struct { // // The returned Conn, if any, will always be of type *Conn. func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { - return nil, errors.New("tls:DialContext not implmented") + return nil, errors.New("tls:DialContext not implemented") } // LoadX509KeyPair reads and parses a public/private key pair from a pair diff --git a/src/machine/machine_atmega1280.go b/src/machine/machine_atmega1280.go index 49564a3ce3..1b8cb848de 100644 --- a/src/machine/machine_atmega1280.go +++ b/src/machine/machine_atmega1280.go @@ -180,7 +180,7 @@ func (pwm PWM) Configure(config PWMConfig) error { // Set the PWM mode to fast PWM (mode = 3). avr.TCCR0A.Set(avr.TCCR0A_WGM00 | avr.TCCR0A_WGM01) // monotonic timer is using the same time as PWM:0 - // we must adust internal settings of monotonic timer when PWM:0 settings changed + // we must adjust internal settings of monotonic timer when PWM:0 settings changed adjustMonotonicTimer() } else { avr.TCCR2B.Set(prescaler) @@ -718,7 +718,7 @@ func (pwm PWM) Set(channel uint8, value uint32) { } } // monotonic timer is using the same time as PWM:0 - // we must adust internal settings of monotonic timer when PWM:0 settings changed + // we must adjust internal settings of monotonic timer when PWM:0 settings changed adjustMonotonicTimer() case 1: mask := interrupt.Disable() diff --git a/src/machine/machine_atmega328.go b/src/machine/machine_atmega328.go index e4b2bb06f9..c354ccb888 100644 --- a/src/machine/machine_atmega328.go +++ b/src/machine/machine_atmega328.go @@ -56,7 +56,7 @@ func (pwm PWM) Configure(config PWMConfig) error { // Set the PWM mode to fast PWM (mode = 3). avr.TCCR0A.Set(avr.TCCR0A_WGM00 | avr.TCCR0A_WGM01) // monotonic timer is using the same time as PWM:0 - // we must adust internal settings of monotonic timer when PWM:0 settings changed + // we must adjust internal settings of monotonic timer when PWM:0 settings changed adjustMonotonicTimer() } else { avr.TCCR2B.Set(prescaler) @@ -385,7 +385,7 @@ func (pwm PWM) Set(channel uint8, value uint32) { } } // monotonic timer is using the same time as PWM:0 - // we must adust internal settings of monotonic timer when PWM:0 settings changed + // we must adjust internal settings of monotonic timer when PWM:0 settings changed adjustMonotonicTimer() case 1: mask := interrupt.Disable() diff --git a/src/machine/machine_esp32c3.go b/src/machine/machine_esp32c3.go index b1ad0bc2fc..727fcc1e64 100644 --- a/src/machine/machine_esp32c3.go +++ b/src/machine/machine_esp32c3.go @@ -480,7 +480,7 @@ func (uart *UART) enableTransmitter() { uart.Bus.SetCONF0_TXFIFO_RST(0) // TXINFO empty threshold is when txfifo_empty_int interrupt produced after the amount of data in Tx-FIFO is less than this register value. uart.Bus.SetCONF1_TXFIFO_EMPTY_THRHD(uart_empty_thresh_default) - // we are not using interrut on TX since write we are waiting for FIFO to have space. + // we are not using interrupt on TX since write we are waiting for FIFO to have space. // uart.Bus.INT_ENA.SetBits(esp.UART_INT_ENA_TXFIFO_EMPTY_INT_ENA) } diff --git a/src/machine/machine_mimxrt1062.go b/src/machine/machine_mimxrt1062.go index 8c42c55645..74d01c7661 100644 --- a/src/machine/machine_mimxrt1062.go +++ b/src/machine/machine_mimxrt1062.go @@ -451,7 +451,7 @@ func (p Pin) getGPIO() (norm *nxp.GPIO_Type, fast *nxp.GPIO_Type) { } } -// getPad returns both the pad and mux configration registers for a given Pin. +// getPad returns both the pad and mux configuration registers for a given Pin. func (p Pin) getPad() (pad *volatile.Register32, mux *volatile.Register32) { switch p.getPort() { case portA: diff --git a/src/machine/machine_rp2040_i2c.go b/src/machine/machine_rp2040_i2c.go index 7ca2a87cf9..c808a07ca8 100644 --- a/src/machine/machine_rp2040_i2c.go +++ b/src/machine/machine_rp2040_i2c.go @@ -24,7 +24,7 @@ var ( // here: https://github.com/vmilea/pico_i2c_slave // Features: Taken from datasheet. -// Default controller mode, with target mode available (not simulataneously). +// Default controller mode, with target mode available (not simultaneously). // Default target address of RP2040: 0x055 // Supports 10-bit addressing in controller mode // 16-element transmit buffer diff --git a/src/machine/machine_stm32f103.go b/src/machine/machine_stm32f103.go index 66a74d04b6..545c431110 100644 --- a/src/machine/machine_stm32f103.go +++ b/src/machine/machine_stm32f103.go @@ -399,7 +399,7 @@ func (i2c *I2C) getFreqRange(config I2CConfig) uint32 { // pclk1 clock speed is main frequency divided by PCLK1 prescaler (div 2) pclk1 := CPUFrequency() / 2 - // set freqency range to PCLK1 clock speed in MHz + // set frequency range to PCLK1 clock speed in MHz // aka setting the value 36 means to use 36 MHz clock return pclk1 / 1000000 } diff --git a/src/machine/machine_stm32l0.go b/src/machine/machine_stm32l0.go index e3fcefb572..b7dc1581c3 100644 --- a/src/machine/machine_stm32l0.go +++ b/src/machine/machine_stm32l0.go @@ -256,10 +256,10 @@ func (spi SPI) getBaudRate(config SPIConfig) uint32 { } // set frequency dependent on PCLK prescaler. Since these are rather weird - // speeds due to the CPU freqency, pick a range up to that frquency for + // speeds due to the CPU frequency, pick a range up to that frequency for // clients to use more human-understandable numbers, e.g. nearest 100KHz - // These are based on APB2 clock frquency (84MHz on the discovery board) + // These are based on APB2 clock frequency (84MHz on the discovery board) // TODO: also include the MCU/APB clock setting in the equation switch { case localFrequency < 328125: diff --git a/src/machine/machine_stm32l4.go b/src/machine/machine_stm32l4.go index 4eb3588f7b..c22cf616b8 100644 --- a/src/machine/machine_stm32l4.go +++ b/src/machine/machine_stm32l4.go @@ -327,10 +327,10 @@ func (spi SPI) getBaudRate(config SPIConfig) uint32 { localFrequency := config.Frequency // set frequency dependent on PCLK prescaler. Since these are rather weird - // speeds due to the CPU freqency, pick a range up to that frquency for + // speeds due to the CPU frequency, pick a range up to that frequency for // clients to use more human-understandable numbers, e.g. nearest 100KHz - // These are based on 80MHz peripheral clock frquency + // These are based on 80MHz peripheral clock frequency switch { case localFrequency < 312500: conf = stm32.SPI_CR1_BR_Div256 diff --git a/src/os/exec.go b/src/os/exec.go index cf295e6fb7..1ea9dcbd8c 100644 --- a/src/os/exec.go +++ b/src/os/exec.go @@ -88,6 +88,7 @@ func (p *Process) Release() error { return p.release() } +// FindProcess looks for a running process by its pid. // Keep compatibility with golang and always succeed and return new proc with pid on Linux. func FindProcess(pid int) (*Process, error) { return findProcess(pid) diff --git a/src/os/os_anyos_test.go b/src/os/os_anyos_test.go index 67c609949e..7b4b383772 100644 --- a/src/os/os_anyos_test.go +++ b/src/os/os_anyos_test.go @@ -56,7 +56,7 @@ func TestStatBadDir(t *testing.T) { badDir := filepath.Join(dir, "not-exist/really-not-exist") _, err := Stat(badDir) if pe, ok := err.(*fs.PathError); !ok || !IsNotExist(err) || pe.Path != badDir { - t.Errorf("Mkdir error = %#v; want PathError for path %q satisifying IsNotExist", err, badDir) + t.Errorf("Mkdir error = %#v; want PathError for path %q satisfying IsNotExist", err, badDir) } } diff --git a/src/os/tempfile_test.go b/src/os/tempfile_test.go index d5ade369a0..88f6481c44 100644 --- a/src/os/tempfile_test.go +++ b/src/os/tempfile_test.go @@ -158,7 +158,7 @@ func TestMkdirTempBadDir(t *testing.T) { badDir := filepath.Join(dir, "not-exist") _, err = MkdirTemp(badDir, "foo") if pe, ok := err.(*fs.PathError); !ok || !IsNotExist(err) || pe.Path != badDir { - t.Errorf("TempDir error = %#v; want PathError for path %q satisifying IsNotExist", err, badDir) + t.Errorf("TempDir error = %#v; want PathError for path %q satisfying IsNotExist", err, badDir) } } diff --git a/src/reflect/type.go b/src/reflect/type.go index 1a0d4fc854..aa84c77a24 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -404,7 +404,7 @@ const ( // The base type struct. All type structs start with this. type rawType struct { - meta uint8 // metadata byte, contains kind and flags (see contants above) + meta uint8 // metadata byte, contains kind and flags (see constants above) } // All types that have an element type: named, chan, slice, array, map (but not diff --git a/src/reflect/value_test.go b/src/reflect/value_test.go index 40f0919bdc..508b358ad9 100644 --- a/src/reflect/value_test.go +++ b/src/reflect/value_test.go @@ -164,7 +164,7 @@ func TestTinyMap(t *testing.T) { // make sure we can get it out v2 := refut.MapIndex(ValueOf(unmarshalerText{"x", "y"})) if !v2.IsValid() || !v2.Bool() { - t.Errorf("Failed to look up map struct key with refection") + t.Errorf("Failed to look up map struct key with reflection") } // put in a key with reflection diff --git a/src/runtime/gc_stack_portable.go b/src/runtime/gc_stack_portable.go index f822d8482e..d35e16e30c 100644 --- a/src/runtime/gc_stack_portable.go +++ b/src/runtime/gc_stack_portable.go @@ -26,7 +26,7 @@ type stackChainObject struct { // // Therefore, we only need to scan the system stack. // It is relatively easy to scan the system stack while we're on it: we can -// simply read __stack_pointer and __global_base and scan the area inbetween. +// simply read __stack_pointer and __global_base and scan the area in between. // Unfortunately, it's hard to get the system stack pointer while we're on a // goroutine stack. But when we're on a goroutine stack, the system stack is in // the scheduler which means there shouldn't be anything on the system stack diff --git a/src/runtime/interrupt/interrupt_avr.go b/src/runtime/interrupt/interrupt_avr.go index 0af71a89e5..f27da8a048 100644 --- a/src/runtime/interrupt/interrupt_avr.go +++ b/src/runtime/interrupt/interrupt_avr.go @@ -27,7 +27,7 @@ func Disable() (state State) { // Restore restores interrupts to what they were before. Give the previous state // returned by Disable as a parameter. If interrupts were disabled before // calling Disable, this will not re-enable interrupts, allowing for nested -// cricital sections. +// critical sections. func Restore(state State) { // SREG is at I/O address 0x3f. device.AsmFull("out 0x3f, {state}", map[string]interface{}{ diff --git a/src/runtime/interrupt/interrupt_cortexm.go b/src/runtime/interrupt/interrupt_cortexm.go index a34dff7879..708d486bdf 100644 --- a/src/runtime/interrupt/interrupt_cortexm.go +++ b/src/runtime/interrupt/interrupt_cortexm.go @@ -46,7 +46,7 @@ func Disable() (state State) { // Restore restores interrupts to what they were before. Give the previous state // returned by Disable as a parameter. If interrupts were disabled before // calling Disable, this will not re-enable interrupts, allowing for nested -// cricital sections. +// critical sections. func Restore(state State) { arm.EnableInterrupts(uintptr(state)) } diff --git a/src/runtime/interrupt/interrupt_gameboyadvance.go b/src/runtime/interrupt/interrupt_gameboyadvance.go index 13f5fbe09d..2224066ed7 100644 --- a/src/runtime/interrupt/interrupt_gameboyadvance.go +++ b/src/runtime/interrupt/interrupt_gameboyadvance.go @@ -92,7 +92,7 @@ func Disable() (state State) { // Restore restores interrupts to what they were before. Give the previous state // returned by Disable as a parameter. If interrupts were disabled before // calling Disable, this will not re-enable interrupts, allowing for nested -// cricital sections. +// critical sections. func Restore(state State) { // Restore interrupts to the previous state. gba.INTERRUPT.PAUSE.Set(uint16(state)) diff --git a/src/runtime/interrupt/interrupt_none.go b/src/runtime/interrupt/interrupt_none.go index 255fca9ea8..2f4aae6c8a 100644 --- a/src/runtime/interrupt/interrupt_none.go +++ b/src/runtime/interrupt/interrupt_none.go @@ -21,7 +21,7 @@ func Disable() (state State) { // Restore restores interrupts to what they were before. Give the previous state // returned by Disable as a parameter. If interrupts were disabled before // calling Disable, this will not re-enable interrupts, allowing for nested -// cricital sections. +// critical sections. func Restore(state State) {} // In returns whether the system is currently in an interrupt. diff --git a/src/runtime/interrupt/interrupt_tinygoriscv.go b/src/runtime/interrupt/interrupt_tinygoriscv.go index 2b97a2f11a..fd21afcda9 100644 --- a/src/runtime/interrupt/interrupt_tinygoriscv.go +++ b/src/runtime/interrupt/interrupt_tinygoriscv.go @@ -23,7 +23,7 @@ func Disable() (state State) { // Restore restores interrupts to what they were before. Give the previous state // returned by Disable as a parameter. If interrupts were disabled before // calling Disable, this will not re-enable interrupts, allowing for nested -// cricital sections. +// critical sections. func Restore(state State) { riscv.EnableInterrupts(uintptr(state)) } diff --git a/src/runtime/interrupt/interrupt_xtensa.go b/src/runtime/interrupt/interrupt_xtensa.go index fe962f0451..69dc711836 100644 --- a/src/runtime/interrupt/interrupt_xtensa.go +++ b/src/runtime/interrupt/interrupt_xtensa.go @@ -23,7 +23,7 @@ func Disable() (state State) { // Restore restores interrupts to what they were before. Give the previous state // returned by Disable as a parameter. If interrupts were disabled before // calling Disable, this will not re-enable interrupts, allowing for nested -// cricital sections. +// critical sections. func Restore(state State) { device.AsmFull("wsr {state}, PS", map[string]interface{}{ "state": state, diff --git a/src/sync/mutex_test.go b/src/sync/mutex_test.go index 1e398e5aca..be24d93031 100644 --- a/src/sync/mutex_test.go +++ b/src/sync/mutex_test.go @@ -120,7 +120,7 @@ func TestRWMutexUncontended(t *testing.T) { mu.Lock() mu.Unlock() - // Acuire several read locks. + // Acquire several read locks. const n = 5 for i := 0; i < n; i++ { mu.RLock()