chore(lint): add new linters and update codebase

- add canonicalheader
- add copyloopvar
- add fatcontext
- add intrange
This commit is contained in:
Quentin McGaw
2024-10-11 18:28:00 +00:00
parent 3c8e80a1a4
commit abe9dcbe33
77 changed files with 8 additions and 116 deletions

View File

@@ -104,7 +104,6 @@ func (f Firewall) toLinesNode() (node *gotree.Node) {
if len(f.OutboundSubnets) > 0 {
outboundSubnets := node.Appendf("Outbound subnets:")
for _, subnet := range f.OutboundSubnets {
subnet := subnet
outboundSubnets.Appendf("%s", &subnet)
}
}

View File

@@ -59,7 +59,6 @@ func Test_Firewall_validate(t *testing.T) {
}
for name, testCase := range testCases {
testCase := testCase
t.Run(name, func(t *testing.T) {
t.Parallel()

View File

@@ -32,7 +32,6 @@ func Test_ivpnAccountID(t *testing.T) {
}
for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.s, func(t *testing.T) {
t.Parallel()

View File

@@ -86,7 +86,6 @@ func Test_Settings_String(t *testing.T) {
}
for name, testCase := range testCases {
testCase := testCase
t.Run(name, func(t *testing.T) {
t.Parallel()

View File

@@ -73,7 +73,6 @@ PresharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g=
}
for testName, testCase := range testCases {
testCase := testCase
t.Run(testName, func(t *testing.T) {
t.Parallel()
@@ -123,7 +122,6 @@ Address = 10.38.22.35/32
}
for testName, testCase := range testCases {
testCase := testCase
t.Run(testName, func(t *testing.T) {
t.Parallel()
@@ -184,7 +182,6 @@ Endpoint = 1.2.3.4:51820`,
}
for testName, testCase := range testCases {
testCase := testCase
t.Run(testName, func(t *testing.T) {
t.Parallel()

View File

@@ -91,7 +91,6 @@ func Test_Source_Get(t *testing.T) {
}
for name, testCase := range testCases {
testCase := testCase
t.Run(name, func(t *testing.T) {
t.Parallel()