From db9e37b3bb282441a855c800675ca72fbcbb1f7d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 3 Sep 2019 18:06:16 +0300 Subject: [PATCH] *: fix golint's omit type suggestions pkg/core/transaction/attribute.go:67:14: should omit type uint8 from declaration of var urllen; it will be inferred from the right-hand side pkg/crypto/keys/publickey.go:184:8: should omit type []byte from declaration of var b; it will be inferred from the right-hand side pkg/network/payload/version_test.go:15:12: should omit type bool from declaration of var relay; it will be inferred from the right-hand side Refs. #213. --- pkg/core/transaction/attribute.go | 2 +- pkg/crypto/keys/publickey.go | 2 +- pkg/network/payload/version_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/core/transaction/attribute.go b/pkg/core/transaction/attribute.go index b54273d40..3619fe931 100644 --- a/pkg/core/transaction/attribute.go +++ b/pkg/core/transaction/attribute.go @@ -64,7 +64,7 @@ func (attr *Attribute) EncodeBinary(w io.Writer) error { Remark12, Remark13, Remark14, Remark15: bw.WriteBytes(attr.Data) case DescriptionURL: - var urllen uint8 = uint8(len(attr.Data)) + var urllen = uint8(len(attr.Data)) bw.WriteLE(urllen) fallthrough case Script, ContractHash, Vote, Hash1, Hash2, Hash3, Hash4, Hash5, Hash6, diff --git a/pkg/crypto/keys/publickey.go b/pkg/crypto/keys/publickey.go index 6bf51657e..d5ea7e419 100644 --- a/pkg/crypto/keys/publickey.go +++ b/pkg/crypto/keys/publickey.go @@ -181,7 +181,7 @@ func (p *PublicKey) Signature() []byte { // Address returns a base58-encoded NEO-specific address based on the key hash. func (p *PublicKey) Address() string { - var b []byte = p.Signature() + var b = p.Signature() b = append([]byte{0x17}, b...) csum := hash.Checksum(b) diff --git a/pkg/network/payload/version_test.go b/pkg/network/payload/version_test.go index c67e8357b..ca4ed156d 100644 --- a/pkg/network/payload/version_test.go +++ b/pkg/network/payload/version_test.go @@ -12,7 +12,7 @@ func TestVersionEncodeDecode(t *testing.T) { var id uint32 = 13337 useragent := "/NEO:0.0.1/" var height uint32 = 100500 - var relay bool = true + var relay = true version := NewVersion(id, port, useragent, height, relay)