Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Jun 21, 2024
1 parent 8446bb6 commit f5a3882
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ linters:
- govet
- stylecheck
- staticcheck
# - goerr113
# - err113
- unconvert
- unparam
- nakedret
- prealloc
- gosimple
- gosec
- ineffassign
- depguard
- typecheck
- misspell
- bodyclose
Expand All @@ -48,7 +47,7 @@ issues:
- golint
text: "should be"
- linters:
- goerr113
- err113
text: "do not define dynamic errors"
- linters:
- stylecheck
Expand Down
2 changes: 1 addition & 1 deletion mdbx/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ func TestEnv_CloseDBI(t *testing.T) {
return
}

//nolint:goerr113
//nolint:err113
if stat.Entries != numdb {
t.Errorf("unexpected entries: %d (not %d)", stat.Entries, numdb)
}
Expand Down
4 changes: 2 additions & 2 deletions mdbx/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ func IsMapFull(err error) bool {

// IsErrno returns true if err's errno is the given errno.
func IsErrno(err error, errno Errno) bool {
return IsErrnoFn(err, func(err error) bool { return err == errno }) //nolint:goerr113
return IsErrnoFn(err, func(err error) bool { return err == errno }) //nolint:err113
}

// IsErrnoSys returns true if err's errno is the given errno.
func IsErrnoSys(err error, errno syscall.Errno) bool {
return IsErrnoFn(err, func(err error) bool { return err == errno }) //nolint:goerr113
return IsErrnoFn(err, func(err error) bool { return err == errno }) //nolint:err113
}

// IsErrnoFn calls fn on the error underlying err and returns the result. If
Expand Down
4 changes: 2 additions & 2 deletions mdbx/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ func TestErrno(t *testing.T) {
t.Errorf("errno(0) != nil: %#v", zeroerr)
}
syserr := _operrno("testop", int(syscall.EINVAL))
//nolint:goerr113
//nolint:err113
if syserr.(*OpError).Errno != syscall.EINVAL { // fails if error is Errno(syscall.EINVAL)
t.Errorf("errno(syscall.EINVAL) != syscall.EINVAL: %#v", syserr)
}
mdberr := _operrno("testop", int(KeyExist))
//nolint:goerr113
//nolint:err113
if mdberr.(*OpError).Errno != KeyExist {
t.Errorf("errno(ErrKeyExist) != ErrKeyExist: %#v", syserr)
}
Expand Down
2 changes: 1 addition & 1 deletion mdbx/msgfunc.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type msgfunc func(string) error
// not contain pointers in their struct fields. See the following language
// proposal which discusses the restrictions on passing pointers to C.
//
// https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md
// https://github.com/golang/proposal/blob/master/design/12416-cgo-pointers.md
type msgctx uintptr
type _msgctx struct {
fn msgfunc
Expand Down

0 comments on commit f5a3882

Please sign in to comment.