Skip to content

Commit

Permalink
Update all tools dependencies and fix subsequent lint errors.
Browse files Browse the repository at this point in the history
Replaces #3742

Signed-off-by: Thomas Hallgren <thomas@tada.se>
  • Loading branch information
thallgren committed Dec 12, 2024
1 parent 36014be commit 8aa4941
Show file tree
Hide file tree
Showing 42 changed files with 1,319 additions and 2,509 deletions.
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ linters:
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- cyclop
- decorder
- depguard
- dogsled
- durationcheck
- errcheck
- errname
- exportloopref
- forbidigo
- gochecknoglobals
- gocognit
Expand Down Expand Up @@ -140,7 +140,6 @@ linters:
- err113
- godox
- goimports
- gomnd
- gomoddirectives
- gosec
- interfacebloat
Expand Down
1 change: 0 additions & 1 deletion cmd/traffic/cmd/manager/managerutil/envconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func TestEnvconfig(t *testing.T) {
}

for tcName, tc := range testcases {
tc := tc // Capture loop variable...
t.Run(tcName, func(t *testing.T) {
t.Parallel()
lookup := func(key string) (string, bool) {
Expand Down
2 changes: 0 additions & 2 deletions cmd/traffic/cmd/manager/mutator/agent_injector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ func TestTrafficAgentConfigGenerator(t *testing.T) {
}

for _, test := range tests {
test := test // pin it
t.Run(test.name, func(t *testing.T) {
runFunc(t, &test, k8sapi.Http2Probe)
})
Expand Down Expand Up @@ -1820,7 +1819,6 @@ func TestTrafficAgentInjector(t *testing.T) {
}

for _, test := range tests {
test := test // pin it
t.Run(test.name, func(t *testing.T) {
ctx := dlog.NewTestContext(t, false)
env := &managerutil.Env{
Expand Down
1 change: 0 additions & 1 deletion integration_test/ignored_mounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func (s *mountsSuite) Test_IgnoredMounts() {
defer cancel()

for _, tt := range tests {
tt := tt
s.Run(tt.name, func() {
tpl := struct {
Annotations map[string]string
Expand Down
1 change: 0 additions & 1 deletion integration_test/intercept_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func (s *interceptFlagSuite) Test_ContainerReplace() {
}

for _, tt := range tests {
tt := tt
s.Run(tt.name, func() {
ctx := s.Context()
expectedOutput := regexp.MustCompile(tt.iceptName + ` from intercept at`)
Expand Down
1 change: 0 additions & 1 deletion integration_test/kubeconfig_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ func (s *notConnectedSuite) Test_DNSSuffixRules() {
logFile := filepath.Join(filelocation.AppUserLogDir(s.Context()), "daemon.log")

for _, tt := range tests {
tt := tt
s.Run(tt.name, func() {
ctx := s.Context()
if len(tt.configIncludeSuffixes) > 0 {
Expand Down
2 changes: 0 additions & 2 deletions integration_test/mounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ func (s *mountsSuite) Test_CollidingMounts() {
}

for i, tt := range tests {
i := i
tt := tt
s.Run(tt.name, func() {
ctx := s.Context()
require := s.Require()
Expand Down
1 change: 0 additions & 1 deletion integration_test/pod_cidr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func (s *podCIDRSuite) Test_PodCIDRStrategy() {
vFile := filepath.Join(vDir, "values.yaml")

for _, tt := range tests {
tt := tt
s.Run(tt.name, func() {
rq := s.Require()
vy, err := yaml.Marshal(tt.values)
Expand Down
1 change: 0 additions & 1 deletion integration_test/proxy_via_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func (s *proxyViaSuite) Test_ProxyViaLoopBack() {
},
}
for _, tt := range tests {
tt := tt
s.Run(tt.name, func() {
rq := s.Require()
var vip netip.Addr
Expand Down
4 changes: 0 additions & 4 deletions pkg/client/cli/cmd/gather_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func Test_gatherLogsZipFiles(t *testing.T) {

for _, tc := range testCases {
tcName := tc.name
tc := tc
t.Run(tcName, func(t *testing.T) {
var fileNames []string
fileNames = append(fileNames, tc.realFileNames...)
Expand Down Expand Up @@ -137,7 +136,6 @@ func Test_gatherLogsCopyFiles(t *testing.T) {
}
for _, tc := range testCases {
tcName := tc.name
tc := tc
t.Run(tcName, func(t *testing.T) {
if tc.outputDir == "" {
tc.outputDir = t.TempDir()
Expand Down Expand Up @@ -212,7 +210,6 @@ func Test_gatherLogsNoK8s(t *testing.T) {

for _, tc := range testCases {
tcName := tc.name
tc := tc
t.Run(tcName, func(t *testing.T) {
// Use this time to validate that the zip file says the
// files inside were modified after the test started.
Expand Down Expand Up @@ -424,7 +421,6 @@ func Test_gatherLogsSignificantPodNames(t *testing.T) {

for _, tc := range testCases {
tcName := tc.name
tc := tc
// We need a fresh anonymizer for each test
t.Run(tcName, func(t *testing.T) {
sigPodNames := getSignificantPodNames(tc.podName)
Expand Down
1 change: 0 additions & 1 deletion pkg/client/cli/cmd/legacy_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func Test_legacyCommands(t *testing.T) {

for _, tc := range testCases {
tcName := tc.name
tc := tc
t.Run(tcName, func(t *testing.T) {
inputArgs := strings.Split(tc.inputLegacyCommand, " ")
genTPCmd, msg, _, err := translateLegacy(inputArgs)
Expand Down
1 change: 0 additions & 1 deletion pkg/client/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func TestGetInstallMechanism(t *testing.T) {
return nil
}
for tcName, tcData := range testcases {
tcData := tcData
t.Run(tcName, func(t *testing.T) {
// Create the fake binary for our test
// We include the tcName in the filePath, so we don't have to worry about
Expand Down
1 change: 0 additions & 1 deletion pkg/filelocation/os_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func TestUser(t *testing.T) {
}
origEnv := os.Environ()
for tcName, tcData := range testcases {
tcData := tcData
t.Run(tcName, func(t *testing.T) {
if runtime.GOOS == "windows" {
splitAndRejoin := func(path *string) {
Expand Down
1 change: 0 additions & 1 deletion pkg/matcher/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func Test_headers_Matches(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
hm, err := NewHeaders(tt.match)
assert.NoError(t, err)
Expand Down
2 changes: 0 additions & 2 deletions pkg/subnet/bitfield256_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func TestByteSet_Mask(t *testing.T) {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
gotOnes, gotValue := tt.set.Mask()
if gotOnes != tt.wantOnes {
Expand Down Expand Up @@ -107,7 +106,6 @@ func TestByteSet_String(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
if got := tt.set.String(); got != tt.want {
t.Errorf("String() = %v, want %v", got, tt.want)
Expand Down
1 change: 0 additions & 1 deletion pkg/subnet/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func TestUnique(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
if got := Unique(tt.subnets); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Unique() = %v, want %v", got, tt.want)
Expand Down
2 changes: 1 addition & 1 deletion rpc/agent/agent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8aa4941

Please sign in to comment.