From a1b2ef3e8e1009ed6f9e8e9b389a70c41ee74399 Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Mon, 13 Nov 2017 16:00:42 +0900 Subject: gobgp/cmd/global: Fix name collision "net" The variable "net" in ParsePath() collides the name of the standard library name "net". Signed-off-by: IWASE Yusuke --- gobgp/cmd/global.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gobgp/cmd/global.go b/gobgp/cmd/global.go index f2904e8b..30f94b5f 100644 --- a/gobgp/cmd/global.go +++ b/gobgp/cmd/global.go @@ -771,11 +771,11 @@ func ParsePath(rf bgp.RouteFamily, args []string) (*table.Path, error) { if len(args) < 1 { return nil, fmt.Errorf("invalid format") } - ip, net, err := net.ParseCIDR(args[0]) + ip, nw, err := net.ParseCIDR(args[0]) if err != nil { return nil, err } - ones, _ := net.Mask.Size() + ones, _ := nw.Mask.Size() if rf == bgp.RF_IPv4_UC { if ip.To4() == nil { return nil, fmt.Errorf("invalid ipv4 prefix") @@ -803,8 +803,8 @@ func ParsePath(rf bgp.RouteFamily, args []string) (*table.Path, error) { if len(args) < 5 || args[1] != "label" || args[3] != "rd" { return nil, fmt.Errorf("invalid format") } - ip, net, _ := net.ParseCIDR(args[0]) - ones, _ := net.Mask.Size() + ip, nw, _ := net.ParseCIDR(args[0]) + ones, _ := nw.Mask.Size() label := 0 if label, err = strconv.Atoi(args[2]); err != nil { @@ -835,8 +835,8 @@ func ParsePath(rf bgp.RouteFamily, args []string) (*table.Path, error) { return nil, fmt.Errorf("invalid format") } - ip, net, _ := net.ParseCIDR(args[0]) - ones, _ := net.Mask.Size() + ip, nw, _ := net.ParseCIDR(args[0]) + ones, _ := nw.Mask.Size() mpls, err := bgp.ParseMPLSLabelStack(args[1]) if err != nil { -- cgit v1.2.3