From 8996a208d9a695bf759308d20b2d94e8b8c741f8 Mon Sep 17 00:00:00 2001 From: Yusef Napora Date: Fri, 8 Nov 2019 11:42:36 -0500 Subject: [PATCH] go fmt --- crypto/envelope.go | 10 +++++----- crypto/envelope_test.go | 2 +- routing/state.go | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crypto/envelope.go b/crypto/envelope.go index daf891f..df8e63b 100644 --- a/crypto/envelope.go +++ b/crypto/envelope.go @@ -20,11 +20,11 @@ type SignedEnvelope struct { // A binary identifier that indicates what kind of data is contained in the payload. // TODO(yusef): enforce multicodec prefix - TypeHint []byte + TypeHint []byte // The envelope payload. This is private to discourage accessing the payload without verifying the signature. // To access, use the Open method. - contents []byte + contents []byte // The signature of the domain string, type hint, and contents. signature []byte @@ -91,8 +91,8 @@ func (e *SignedEnvelope) Marshal() ([]byte, error) { } msg := pb.SignedEnvelope{ PublicKey: key, - TypeHint: e.TypeHint, - Contents: e.contents, + TypeHint: e.TypeHint, + Contents: e.contents, Signature: e.signature, } return proto.Marshal(&msg) @@ -136,4 +136,4 @@ func encodedSize(content []byte) []byte { b := make([]byte, 8) binary.BigEndian.PutUint64(b, uint64(len(content))) return b -} \ No newline at end of file +} diff --git a/crypto/envelope_test.go b/crypto/envelope_test.go index 860ade3..f25a073 100644 --- a/crypto/envelope_test.go +++ b/crypto/envelope_test.go @@ -147,4 +147,4 @@ func TestEnvelopeValidateFailsIfContentsAreAltered(t *testing.T) { if valid { t.Error("envelope should be invalid, but Valid returns true") } -} \ No newline at end of file +} diff --git a/routing/state.go b/routing/state.go index 619b1b6..a32882d 100644 --- a/routing/state.go +++ b/routing/state.go @@ -5,8 +5,8 @@ import ( "github.com/gogo/protobuf/proto" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" - ma "github.com/multiformats/go-multiaddr" pb "github.com/libp2p/go-libp2p-core/routing/pb" + ma "github.com/multiformats/go-multiaddr" "time" ) @@ -47,8 +47,8 @@ func RoutingStateFromAddrInfo(info *peer.AddrInfo) *RoutingState { annotated[i] = &AnnotatedAddr{Multiaddr: a} } return &RoutingState{ - PeerID: info.ID, - Seq: statelessSeqNo(), + PeerID: info.ID, + Seq: statelessSeqNo(), Addresses: annotated, } } @@ -106,8 +106,8 @@ func (s *RoutingState) Marshal() ([]byte, error) { return nil, err } msg := pb.RoutingStateRecord{ - PeerId: id, - Seq: s.Seq, + PeerId: id, + Seq: s.Seq, Addresses: addrsToProtobuf(s.Addresses), } return proto.Marshal(&msg) @@ -147,4 +147,4 @@ func addrsToProtobuf(addrs []*AnnotatedAddr) []*pb.RoutingStateRecord_AddressInf out = append(out, &pb.RoutingStateRecord_AddressInfo{Multiaddr: addr.Bytes()}) } return out -} \ No newline at end of file +}