diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc9b2ef..b73c4c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v9 with: - version: v2.11.4 + version: v2.12.2 args: --timeout=5m test-unit: diff --git a/pkg/common/util/util_test.go b/pkg/common/util/util_test.go index 14d840b..efb32a4 100644 --- a/pkg/common/util/util_test.go +++ b/pkg/common/util/util_test.go @@ -15,6 +15,7 @@ import ( const ( testVPC = "0000000jU" // 1234 dec testVPCAttachment = "00G" // 42 dec + testIPv6Segment = "2607:ed40:ff00::1" ) func TestGenerateInterfaceNameVRF(t *testing.T) { @@ -55,7 +56,7 @@ func TestParseIP(t *testing.T) { wantError bool }{ {"ValidIPv4", "192.168.0.1", net.ParseIP("192.168.0.1"), false}, - {"ValidIPv6", "2607:ed40:ff00::1", net.ParseIP("2607:ed40:ff00::1"), false}, + {"ValidIPv6", testIPv6Segment, net.ParseIP(testIPv6Segment), false}, {"InvalidIP", "not_an_ip", nil, true}, } @@ -81,25 +82,25 @@ func TestParseSegments(t *testing.T) { }{ { "ValidSingleSegment", - []string{"2607:ed40:ff00::1"}, - []net.IP{net.ParseIP("2607:ed40:ff00::1")}, + []string{testIPv6Segment}, + []net.IP{net.ParseIP(testIPv6Segment)}, false, }, { "ValidMultipleSegments", - []string{"2607:ed40:ff00::1", "2607:ed40:ff01::1"}, - []net.IP{net.ParseIP("2607:ed40:ff01::1"), net.ParseIP("2607:ed40:ff00::1")}, + []string{testIPv6Segment, "2607:ed40:ff01::1"}, + []net.IP{net.ParseIP("2607:ed40:ff01::1"), net.ParseIP(testIPv6Segment)}, false, }, { "InvalidSegment", - []string{"2607:ed40:ff00::1", "invalid_ip"}, + []string{testIPv6Segment, "invalid_ip"}, nil, true, }, { "InvalidIPv4Segment", - []string{"2607:ed40:ff00::1", "192.168.0.1"}, + []string{testIPv6Segment, "192.168.0.1"}, nil, true, },