From 1f0834814a49d82d6f6bb91577f0b10179275964 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 31 Mar 2020 07:04:11 +0900 Subject: packet: fix typos Signed-off-by: FUJITA Tomonori --- pkg/packet/mrt/mrt.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/packet/mrt/mrt.go b/pkg/packet/mrt/mrt.go index 70788325..f2005c72 100644 --- a/pkg/packet/mrt/mrt.go +++ b/pkg/packet/mrt/mrt.go @@ -199,11 +199,11 @@ type Peer struct { AS uint32 } -var errNotAllPeerBytesAbailable = errors.New("not all Peer bytes are available") +var errNotAllPeerBytesAvailable = errors.New("not all Peer bytes are available") func (p *Peer) DecodeFromBytes(data []byte) ([]byte, error) { if len(data) < 5 { - return nil, errNotAllPeerBytesAbailable + return nil, errNotAllPeerBytesAvailable } p.Type = uint8(data[0]) p.BgpId = net.IP(data[1:5]) @@ -211,13 +211,13 @@ func (p *Peer) DecodeFromBytes(data []byte) ([]byte, error) { if p.Type&1 > 0 { if len(data) < 16 { - return nil, errNotAllPeerBytesAbailable + return nil, errNotAllPeerBytesAvailable } p.IpAddress = net.IP(data[:16]) data = data[16:] } else { if len(data) < 4 { - return nil, errNotAllPeerBytesAbailable + return nil, errNotAllPeerBytesAvailable } p.IpAddress = net.IP(data[:4]) data = data[4:] @@ -225,13 +225,13 @@ func (p *Peer) DecodeFromBytes(data []byte) ([]byte, error) { if p.Type&(1<<1) > 0 { if len(data) < 4 { - return nil, errNotAllPeerBytesAbailable + return nil, errNotAllPeerBytesAvailable } p.AS = binary.BigEndian.Uint32(data[:4]) data = data[4:] } else { if len(data) < 2 { - return nil, errNotAllPeerBytesAbailable + return nil, errNotAllPeerBytesAvailable } p.AS = uint32(binary.BigEndian.Uint16(data[:2])) data = data[2:] -- cgit v1.2.3