From 1262f5f0cafddcddb33e06c4a3fa93dbefcb2de4 Mon Sep 17 00:00:00 2001 From: Darren O'Connor Date: Sun, 24 Oct 2021 10:30:29 -0400 Subject: [PATCH] simplifycompositelit: No need to specify type in slice --- prefixfile/slurm_test.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/prefixfile/slurm_test.go b/prefixfile/slurm_test.go index e1ec356..9fd5fbd 100644 --- a/prefixfile/slurm_test.go +++ b/prefixfile/slurm_test.go @@ -2,8 +2,9 @@ package prefixfile import ( "bytes" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestDecodeJSON(t *testing.T) { @@ -77,27 +78,27 @@ func TestDecodeJSON(t *testing.T) { func TestFilterOnVRPs(t *testing.T) { vrps := []VRPJson{ - VRPJson{ + { ASN: uint32(65001), Prefix: "192.168.0.0/25", Length: 25, }, - VRPJson{ + { ASN: uint32(65002), Prefix: "192.168.1.0/24", Length: 24, }, - VRPJson{ + { ASN: uint32(65003), Prefix: "192.168.2.0/24", Length: 24, }, - VRPJson{ + { ASN: uint32(65004), Prefix: "10.0.0.0/24", Length: 24, }, - VRPJson{ + { ASN: uint32(65005), Prefix: "10.1.0.0/24", Length: 16, // this VRP is broken, maxlength can't be smaller than plen @@ -106,14 +107,14 @@ func TestFilterOnVRPs(t *testing.T) { slurm := SlurmValidationOutputFilters{ PrefixFilters: []SlurmPrefixFilter{ - SlurmPrefixFilter{ + { Prefix: "10.0.0.0/8", }, - SlurmPrefixFilter{ + { ASN: uint32(65001), Prefix: "192.168.0.0/24", }, - SlurmPrefixFilter{ + { ASN: uint32(65002), }, }, @@ -128,16 +129,16 @@ func TestFilterOnVRPs(t *testing.T) { func TestAssertVRPs(t *testing.T) { slurm := SlurmLocallyAddedAssertions{ PrefixAssertions: []SlurmPrefixAssertion{ - SlurmPrefixAssertion{ + { ASN: uint32(65001), Prefix: "10.0.0.0/8", Comment: "Hello", }, - SlurmPrefixAssertion{ + { ASN: uint32(65001), Prefix: "192.168.0.0/24", }, - SlurmPrefixAssertion{ + { ASN: uint32(65003), Prefix: "192.168.0.0/25", MaxPrefixLength: 26,