From f561312ceb92e85f0aa89b5c92cb04f0bb97f389 Mon Sep 17 00:00:00 2001 From: Eiichiro Watanabe Date: Mon, 19 Oct 2015 14:19:53 +0900 Subject: packet: use %v instead of %s --- packet/mrt.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packet/mrt.go b/packet/mrt.go index ba7dfa06..7c336684 100644 --- a/packet/mrt.go +++ b/packet/mrt.go @@ -700,7 +700,7 @@ func (m *BGP4MPMessage) String() string { if m.isLocal { title += "_LOCAL" } - return fmt.Sprintf("%s: PeerAS [%d] LocalAS [%d] InterfaceIndex [%d] PeerIP [%s] LocalIP [%s] BGPMessage [%s]", title, m.PeerAS, m.LocalAS, m.InterfaceIndex, m.PeerIpAddress, m.LocalIpAddress, m.BGPMessage.String()) + return fmt.Sprintf("%s: PeerAS [%d] LocalAS [%d] InterfaceIndex [%d] PeerIP [%s] LocalIP [%s] BGPMessage [%v]", title, m.PeerAS, m.LocalAS, m.InterfaceIndex, m.PeerIpAddress, m.LocalIpAddress, m.BGPMessage) } //This function can be passed into a bufio.Scanner.Split() to read buffered mrt msgs @@ -746,7 +746,7 @@ func ParseMRTBody(h *MRTHeader, data []byte) (*MRTMessage, error) { rf = RF_IPv6_MC case RIB_GENERIC: default: - return nil, fmt.Errorf("unsupported table dumpv2 subtype: %s\n", subType.String()) + return nil, fmt.Errorf("unsupported table dumpv2 subtype: %v\n", subType) } if subType != PEER_INDEX_TABLE { @@ -781,10 +781,10 @@ func ParseMRTBody(h *MRTHeader, data []byte) (*MRTMessage, error) { isLocal: true, } default: - return nil, fmt.Errorf("unsupported bgp4mp subtype: %s\n", subType.String()) + return nil, fmt.Errorf("unsupported bgp4mp subtype: %v\n", subType) } default: - return nil, fmt.Errorf("unsupported type: %s\n", h.Type.String()) + return nil, fmt.Errorf("unsupported type: %v\n", h.Type) } err := msg.Body.DecodeFromBytes(data) if err != nil { -- cgit v1.2.3