Skip to content

chore: small fixes from linter #4997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -1098,14 +1098,18 @@ endif
tools:
cd internal/tools && go generate -tags tools ./

LINTDIRS=src/os/ src/reflect/
.PHONY: lint
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
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
Expand Down
2 changes: 1 addition & 1 deletion compiler/llvmutil/llvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-") {
Expand Down
1 change: 0 additions & 1 deletion src/os/file_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ package os
import (
"io"
"syscall"
_ "unsafe"
)

const DevNull = "/dev/null"
Expand Down
4 changes: 2 additions & 2 deletions src/reflect/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading