diff --git a/GNUmakefile b/GNUmakefile index 99dc3913b6..148ffdc4d4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1098,6 +1098,7 @@ endif tools: cd internal/tools && go generate -tags tools ./ +LINTDIRS=src/os/ src/reflect/ .PHONY: lint lint: tools ## Lint source tree revive -version @@ -1105,7 +1106,10 @@ lint: tools ## Lint source tree # 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 - 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/... $$( find $(LINTDIRS) -type f -name '*.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 diff --git a/compiler/llvmutil/llvm.go b/compiler/llvmutil/llvm.go index 061bee6c9a..9295c44094 100644 --- a/compiler/llvmutil/llvm.go +++ b/compiler/llvmutil/llvm.go @@ -218,7 +218,7 @@ func Version() int { return major } -// Return the byte order for the given target triple. Most targets are little +// ByteOrder returns the byte order for the given target triple. Most targets are little // endian, but for example MIPS can be big-endian. func ByteOrder(target string) binary.ByteOrder { if strings.HasPrefix(target, "mips-") { diff --git a/src/os/file_unix.go b/src/os/file_unix.go index 9dc3a91e09..17d26e166b 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -12,7 +12,6 @@ package os import ( "io" "syscall" - _ "unsafe" ) const DevNull = "/dev/null" diff --git a/src/reflect/value.go b/src/reflect/value.go index cf186c2ce1..a7e4787c67 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -81,8 +81,8 @@ func (it *MapIter) Next() bool { return ((*reflectlite.MapIter)(it)).Next() } -func (iter *MapIter) Reset(v Value) { - (*reflectlite.MapIter)(iter).Reset(v.Value) +func (it *MapIter) Reset(v Value) { + (*reflectlite.MapIter)(it).Reset(v.Value) } func (v Value) Set(x Value) {