diff options
author | Sergey Elantsev <elantsev.s@yandex.ru> | 2021-01-27 21:43:39 +0300 |
---|---|---|
committer | Sergey Elantsev <elantsev.s@yandex.ru> | 2021-01-27 21:43:39 +0300 |
commit | 72027852e23647ecba0d79ff0f42787bfbe9a4c7 (patch) | |
tree | 1765094bf83faa31b32cbba85a673ae98d890018 | |
parent | 43c62634fdd8ff8e1deb2c20251bbc37718752aa (diff) |
go fmted
-rw-r--r-- | cmd/gobgp/monitor.go | 6 | ||||
-rw-r--r-- | pkg/packet/bgp/bgp.go | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd/gobgp/monitor.go b/cmd/gobgp/monitor.go index bc31bde9..52e1c3b4 100644 --- a/cmd/gobgp/monitor.go +++ b/cmd/gobgp/monitor.go @@ -74,10 +74,10 @@ func makeMonitorRouteArgs(p *api.Path, showIdentifier bgp.BGPAddPathMode) []inte } func monitorRoute(pathList []*api.Path, showIdentifier bgp.BGPAddPathMode) { - var pathStrs [][]interface{} + pathStrs := make([][]interface{}, len(pathList)) - for _, p := range pathList { - pathStrs = append(pathStrs, makeMonitorRouteArgs(p, showIdentifier)) + for i, p := range pathList { + pathStrs[i] = makeMonitorRouteArgs(p, showIdentifier) } format := time.Now().UTC().Format(time.RFC3339) diff --git a/pkg/packet/bgp/bgp.go b/pkg/packet/bgp/bgp.go index c55c4681..5112e7ae 100644 --- a/pkg/packet/bgp/bgp.go +++ b/pkg/packet/bgp/bgp.go @@ -2384,7 +2384,7 @@ func (er *EVPNEthernetAutoDiscoveryRoute) Len() int { func (er *EVPNEthernetAutoDiscoveryRoute) DecodeFromBytes(data []byte) error { er.RD = GetRouteDistinguisher(data) rdLen := er.RD.Len() - if len(data) < rdLen + 14 { // 14 is 10 for + if len(data) < rdLen+14 { // 14 is 10 for return NewMessageError(BGP_ERROR_UPDATE_MESSAGE_ERROR, BGP_ERROR_SUB_MALFORMED_ATTRIBUTE_LIST, nil, "bad Ethernet Auto-discovery Route length") } data = data[er.RD.Len():] @@ -2644,7 +2644,7 @@ func (er *EVPNMulticastEthernetTagRoute) Len() int { func (er *EVPNMulticastEthernetTagRoute) DecodeFromBytes(data []byte) error { er.RD = GetRouteDistinguisher(data) rdLen := er.RD.Len() - if len(data) < rdLen + 4 { + if len(data) < rdLen+4 { return NewMessageError(BGP_ERROR_UPDATE_MESSAGE_ERROR, BGP_ERROR_SUB_MALFORMED_ATTRIBUTE_LIST, nil, "invalid length of multicast ethernet tag route") } data = data[er.RD.Len():] |