diff --git a/route_test.go b/route_test.go index 56c539f..d6655ad 100644 --- a/route_test.go +++ b/route_test.go @@ -569,7 +569,7 @@ func TestRouteMultiPath(t *testing.T) { } idx := link.Attrs().Index - route := Route{Dst: dst, MultiPath: []*NexthopInfo{&NexthopInfo{LinkIndex: idx}, &NexthopInfo{LinkIndex: idx}}} + route := Route{Dst: dst, MultiPath: []*NexthopInfo{{LinkIndex: idx}, {LinkIndex: idx}}} if err := RouteAdd(&route); err != nil { t.Fatal(err) } @@ -719,58 +719,58 @@ func TestRouteEqual(t *testing.T) { seg6encap := &SEG6Encap{Mode: nl.SEG6_IPTUN_MODE_ENCAP} seg6encap.Segments = []net.IP{net.ParseIP("fc00:a000::11")} cases := []Route{ - Route{ + { Dst: nil, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { ILinkIndex: 21, LinkIndex: 20, Dst: nil, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Protocol: 20, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Priority: 20, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Type: 20, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Table: 200, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Tos: 1, Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 20, Dst: nil, Flags: int(FLAG_ONLINK), Gw: net.IPv4(1, 1, 1, 1), }, - Route{ + { LinkIndex: 10, Dst: &net.IPNet{ IP: net.IPv4(192, 168, 0, 0), @@ -778,7 +778,7 @@ func TestRouteEqual(t *testing.T) { }, Src: net.IPv4(127, 1, 1, 1), }, - Route{ + { LinkIndex: 10, Scope: unix.RT_SCOPE_LINK, Dst: &net.IPNet{ @@ -787,7 +787,7 @@ func TestRouteEqual(t *testing.T) { }, Src: net.IPv4(127, 1, 1, 1), }, - Route{ + { LinkIndex: 3, Dst: &net.IPNet{ IP: net.IPv4(1, 1, 1, 1), @@ -800,21 +800,21 @@ func TestRouteEqual(t *testing.T) { Type: unix.RTN_UNICAST, Tos: 14, }, - Route{ + { LinkIndex: 10, MPLSDst: &mplsDst, NewDst: &MPLSDestination{ Labels: []int{200, 300}, }, }, - Route{ + { Dst: nil, Gw: net.IPv4(1, 1, 1, 1), Encap: &MPLSEncap{ Labels: []int{100}, }, }, - Route{ + { LinkIndex: 10, Dst: &net.IPNet{ IP: net.IPv4(10, 0, 0, 102), @@ -822,42 +822,42 @@ func TestRouteEqual(t *testing.T) { }, Encap: seg6encap, }, - Route{ + { Dst: nil, - MultiPath: []*NexthopInfo{&NexthopInfo{LinkIndex: 10}, &NexthopInfo{LinkIndex: 20}}, + MultiPath: []*NexthopInfo{{LinkIndex: 10}, {LinkIndex: 20}}, }, - Route{ + { Dst: nil, - MultiPath: []*NexthopInfo{&NexthopInfo{ + MultiPath: []*NexthopInfo{{ LinkIndex: 10, Gw: net.IPv4(1, 1, 1, 1), - }, &NexthopInfo{LinkIndex: 20}}, + }, {LinkIndex: 20}}, }, - Route{ + { Dst: nil, - MultiPath: []*NexthopInfo{&NexthopInfo{ + MultiPath: []*NexthopInfo{{ LinkIndex: 10, Gw: net.IPv4(1, 1, 1, 1), Encap: &MPLSEncap{ Labels: []int{100}, }, - }, &NexthopInfo{LinkIndex: 20}}, + }, {LinkIndex: 20}}, }, - Route{ + { Dst: nil, - MultiPath: []*NexthopInfo{&NexthopInfo{ + MultiPath: []*NexthopInfo{{ LinkIndex: 10, NewDst: &MPLSDestination{ Labels: []int{200, 300}, }, - }, &NexthopInfo{LinkIndex: 20}}, + }, {LinkIndex: 20}}, }, - Route{ + { Dst: nil, - MultiPath: []*NexthopInfo{&NexthopInfo{ + MultiPath: []*NexthopInfo{{ LinkIndex: 10, Encap: seg6encap, - }, &NexthopInfo{LinkIndex: 20}}, + }, {LinkIndex: 20}}, }, } for i1 := range cases {