Skip to content

Commit

Permalink
fix: linter fixes (#3697)
Browse files Browse the repository at this point in the history
  • Loading branch information
notanatol committed Jan 12, 2023
1 parent eb7b2de commit a56957a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
18 changes: 9 additions & 9 deletions pkg/log/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,55 +36,55 @@ func (p pointErr) MarshalText() ([]byte, error) {
// marshalerTest expect to result in the MarshalLog() value when logged.
type marshalerTest struct{ val string }

func (_ marshalerTest) MarshalLog() interface{} {
func (marshalerTest) MarshalLog() interface{} {
return struct{ Inner string }{"I am a log.Marshaler"}
}
func (_ marshalerTest) String() string {
func (marshalerTest) String() string {
return "String(): you should not see this"
}
func (_ marshalerTest) Error() string {
func (marshalerTest) Error() string {
return "Error(): you should not see this"
}

// nolint:errname
// marshalerPanicTest expect this to result in a panic when logged.
type marshalerPanicTest struct{ val string }

func (_ marshalerPanicTest) MarshalLog() interface{} {
func (marshalerPanicTest) MarshalLog() interface{} {
panic("marshalerPanicTest")
}

// nolint:errname
// stringerTest expect this to result in the String() value when logged.
type stringerTest struct{ val string }

func (_ stringerTest) String() string {
func (stringerTest) String() string {
return "I am a fmt.Stringer"
}
func (_ stringerTest) Error() string {
func (stringerTest) Error() string {
return "Error(): you should not see this"
}

// stringerPanicTest expect this to result in a panic when logged.
type stringerPanicTest struct{ val string }

func (_ stringerPanicTest) String() string {
func (stringerPanicTest) String() string {
panic("stringerPanicTest")
}

// nolint:errname
// errorTest expect this to result in the Error() value when logged.
type errorTest struct{ val string }

func (_ errorTest) Error() string {
func (errorTest) Error() string {
return "I am an error"
}

// nolint:errname
// errorPanicTest expect this to result in a panic when logged.
type errorPanicTest struct{ val string }

func (_ errorPanicTest) Error() string {
func (errorPanicTest) Error() string {
panic("errorPanicTest")
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/manifest/mantaray/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"encoding/hex"
"errors"
"math/rand"
mrand "math/rand"
"reflect"
"testing"

Expand Down Expand Up @@ -50,7 +49,7 @@ type NodeEntry struct {

// nolint:gochecknoinits
func init() {
obfuscationKeyFn = mrand.Read
obfuscationKeyFn = rand.Read
}

func TestVersion01(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/statestore/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/ethersphere/bee/pkg/log"
"github.com/ethersphere/bee/pkg/storage"
"github.com/syndtr/goleveldb/leveldb"

ldberr "github.com/syndtr/goleveldb/leveldb/errors"

ldb "github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb"
ldbs "github.com/syndtr/goleveldb/leveldb/storage"

"github.com/syndtr/goleveldb/leveldb/util"
Expand All @@ -33,7 +33,7 @@ type Store struct {
}

func NewInMemoryStateStore(l log.Logger) (*Store, error) {
ldb, err := ldb.Open(ldbs.NewMemStorage(), nil)
ldb, err := leveldb.Open(ldbs.NewMemStorage(), nil)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a56957a

Please sign in to comment.