Enable thelper linter (#610)

This commit is contained in:
Håvard Anda Estensen 2022-08-31 05:09:44 +02:00 committed by GitHub
parent 1508952df9
commit a9459aea68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -8,7 +8,7 @@ linters:
- unconvert
- predeclared
# - wastedassign # go1.18
# - thelper
- thelper
- gofmt
- errcheck
- gosimple

View File

@ -28,6 +28,7 @@ import (
)
func assertTwoThreeTree(t *testing.T, tree *Tree23, expectedKeysLevelOrder []Felt) {
t.Helper()
treeValid, err := tree.IsValid()
assert.True(t, treeValid, "2-3-tree properties do not hold for tree: %v, error: %v", tree.KeysInLevelOrder(), err)
if expectedKeysLevelOrder != nil {
@ -36,6 +37,7 @@ func assertTwoThreeTree(t *testing.T, tree *Tree23, expectedKeysLevelOrder []Fel
}
func require23Tree(t *testing.T, tree *Tree23, expectedKeysLevelOrder []Felt, input1, input2 []byte) {
t.Helper()
treeValid, err := tree.IsValid()
require.True(t, treeValid, "2-3-tree properties do not hold: input [%v %v] [%+q %+q], error: %v",
input1, input2, string(input1), string(input2), err)

View File

@ -27,6 +27,7 @@ import (
)
func BaseCase(t *testing.T) (kv.RwDB, kv.RwTx, kv.RwCursorDupSort) {
t.Helper()
path := t.TempDir()
logger := log.New()
table := "Table"
@ -53,6 +54,7 @@ func BaseCase(t *testing.T) (kv.RwDB, kv.RwTx, kv.RwCursorDupSort) {
}
func iteration(t *testing.T, c kv.RwCursorDupSort, start []byte, val []byte) ([]string, []string) {
t.Helper()
var keys []string
var values []string
var err error
@ -553,6 +555,7 @@ func TestDupDelete(t *testing.T) {
}
func baseAutoConversion(t *testing.T) (kv.RwDB, kv.RwTx, kv.RwCursor) {
t.Helper()
path := t.TempDir()
logger := log.New()
db := NewMDBX(logger).Path(path).MustOpen()