Skip to content

Commit

Permalink
linter fixes + go version to 1.22 + added 1 more linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Miheev committed Jun 17, 2024
1 parent e921652 commit c88e3bf
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ linters:
- depguard
- typecheck
- misspell
- bodyclose
- noctx

linters-settings:
gofmt:
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ race:
go test -race ./mdbx ./exp/mdbxpool

lint:
./build/bin/golangci-lint run --new-from-rev=$(MASTER_COMMIT) ./...
./build/bin/golangci-lint run ./...
#//--new-from-rev=$(MASTER_COMMIT) ./...

lintci-deps:
rm -f ./build/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.55.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.59.1

clean:
cd mdbxdist && make clean
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/erigontech/mdbx-go

go 1.15
go 1.22

require github.com/ianlancetaylor/cgosymbolizer v0.0.0-20240503222823-736c933a666d
8 changes: 4 additions & 4 deletions mdbx/cursor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ func TestDupCursor_EmptyKeyValues1(t *testing.T) {
if !bytes.Equal(v, []byte{}) {
panic(fmt.Sprintf("%x", v))
}
k, v, err = cur.Get([]byte{}, nil, Set)
k, _, err = cur.Get([]byte{}, nil, Set)
if err == nil {
panic("expected 'not found' error")
}
Expand Down Expand Up @@ -865,7 +865,7 @@ func TestDupCursor_EmptyKeyValues2(t *testing.T) {
if !bytes.Equal(v, []byte{}) {
panic(fmt.Sprintf("%x", v))
}
k, v, err = cur.Get([]byte{}, nil, Set)
k, _, err = cur.Get([]byte{}, nil, Set)
if err == nil {
panic("expected 'not found' error")
}
Expand Down Expand Up @@ -969,7 +969,7 @@ func TestDupCursor_EmptyKeyValues3(t *testing.T) {
if !bytes.Equal(v, []byte{}) {
panic(fmt.Sprintf("%x", v))
}
k, v, err = cur.Get([]byte{}, nil, Set)
k, _, err = cur.Get([]byte{}, nil, Set)
if err == nil {
panic("expected 'not found' error")
}
Expand Down Expand Up @@ -1082,7 +1082,7 @@ func TestDupCursor_EmptyKeyValues(t *testing.T) {
if !bytes.Equal(v, []byte{}) {
panic(fmt.Sprintf("%x", v))
}
k, v, err = cur.Get([]byte{}, nil, Set)
k, _, err = cur.Get([]byte{}, nil, Set)
if err == nil {
panic("expected 'not found' error")
}
Expand Down
2 changes: 1 addition & 1 deletion mdbx/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ type Stat struct {
LeafPages uint64 // Number of leaf pages
OverflowPages uint64 // Number of overflow pages
Entries uint64 // Number of data items
LastTxId uint64 // Transaction ID of commited last modification
LastTxId uint64 // Transaction ID of committed last modification
}

// Stat returns statistics about the environment.
Expand Down
2 changes: 1 addition & 1 deletion mdbx/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (err *OpError) Error() string {
// lmdb.IsErrnoFn(err, os.IsPermission)
type Errno C.int

// The most common error codes do not need to be handled explicity. Errors can
// The most common error codes do not need to be handled explicitly. Errors can
// be checked through helper functions IsNotFound, IsMapFull, etc, Otherwise
// they should be checked using the IsErrno function instead of direct
// comparison because they will typically be wrapped with an OpError.
Expand Down
2 changes: 1 addition & 1 deletion mdbx/mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ they fail get garbage collected.
Write transactions (those created without the Readonly flag) must be created in
a goroutine that has been locked to its thread by calling the function
runtime.LockOSThread. Futhermore, all methods on such transactions must be
runtime.LockOSThread. Furthermore, all methods on such transactions must be
called from the goroutine which created them. This is a fundamental limitation
of LMDB even when using the NoTLS flag (which the package always uses). The
Env.Update method assists the programmer by calling runtime.LockOSThread
Expand Down

0 comments on commit c88e3bf

Please sign in to comment.