Skip to content

Commit

Permalink
go vet:
Browse files Browse the repository at this point in the history
-  ./codec.go:257:
PrintTypes passes lock by value: amino.Codec contains sync.RWMutex
- remove some unused (unexported) methods
  • Loading branch information
liamsi committed Sep 8, 2018
1 parent dbdbbcd commit 3af4656
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
28 changes: 0 additions & 28 deletions binary-decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"reflect"
"time"

"encoding/binary"
"github.com/davecgh/go-spew/spew"
)

Expand Down Expand Up @@ -838,33 +837,6 @@ func consumeAny(typ3 Typ3, bz []byte) (n int, err error) {
return
}

func consumeStruct(bz []byte) (n int, err error) {
var _n, typ = int(0), Typ3(0x00)
for {
typ, _n, err = consumeFieldKey(bz)
if slide(&bz, &n, _n) && err != nil {
return
}
_n, err = consumeAny(typ, bz)
if slide(&bz, &n, _n) && err != nil {
return
}
}
return
}

func consumeFieldKey(bz []byte) (typ Typ3, n int, err error) {
var u64 uint64
u64, n = binary.Uvarint(bz)
if n < 0 {
n = 0
err = errors.New("error decoding uvarint")
return
}
typ = Typ3(u64 & 0x07)
return
}

//----------------------------------------

func DecodeDisambPrefixBytes(bz []byte) (db DisambBytes, hasDb bool, pb PrefixBytes, hasPb bool, n int, err error) {
Expand Down
2 changes: 1 addition & 1 deletion codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (cdc *Codec) Seal() *Codec {
// | Type | Name | Prefix | Notes |
//
// Where Type is the golang type name and Name is the name the type was registered with.
func (cdc Codec) PrintTypes(out io.Writer) error {
func (cdc *Codec) PrintTypes(out io.Writer) error {
cdc.mtx.RLock()
defer cdc.mtx.RUnlock()
// print header
Expand Down

0 comments on commit 3af4656

Please sign in to comment.