diff --git a/cmd/ttn-lw-cli/commands/events.go b/cmd/ttn-lw-cli/commands/events.go index 9bde0aae5f..6650d03f86 100644 --- a/cmd/ttn-lw-cli/commands/events.go +++ b/cmd/ttn-lw-cli/commands/events.go @@ -74,7 +74,6 @@ var eventsCommand = &cobra.Command{ }() for _, address := range getEventsAddresses() { - address := address // shadow loop variable. g.Go(func() error { conn, err := api.Dial(gCtx, address) if err != nil { @@ -137,7 +136,6 @@ var eventsFindRelatedCommand = &cobra.Command{ }() for _, address := range getEventsAddresses() { - address := address // shadow loop variable. g.Go(func() error { conn, err := api.Dial(gCtx, address) if err != nil { diff --git a/pkg/applicationserver/grpc_deviceregistry_test.go b/pkg/applicationserver/grpc_deviceregistry_test.go index a6224f75ef..1569e248ab 100644 --- a/pkg/applicationserver/grpc_deviceregistry_test.go +++ b/pkg/applicationserver/grpc_deviceregistry_test.go @@ -1163,7 +1163,6 @@ func TestDeviceRegistryBatchDelete(t *testing.T) { // nolint:paralleltest BatchDeleteCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/applicationserver/io/mqtt/topics/v3_test.go b/pkg/applicationserver/io/mqtt/topics/v3_test.go index f4fdcc0123..cc56b1e03a 100644 --- a/pkg/applicationserver/io/mqtt/topics/v3_test.go +++ b/pkg/applicationserver/io/mqtt/topics/v3_test.go @@ -64,7 +64,6 @@ func TestV3AcceptedTopic(t *testing.T) { OK: true, }, } { - tc := tc t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -139,7 +138,6 @@ func TestV3Topics(t *testing.T) { Expected: fmt.Sprintf("v3/%s/devices/%s/down/replace", appUID, devID), }, } { - tc := tc t.Run(tc.Expected, func(t *testing.T) { t.Parallel() actual := strings.Join(tc.Fn(appUID, devID), "/") diff --git a/pkg/applicationserver/io/packages/alcsync/v1/alcsync_test.go b/pkg/applicationserver/io/packages/alcsync/v1/alcsync_test.go index 8be3bec112..7ff45165dd 100644 --- a/pkg/applicationserver/io/packages/alcsync/v1/alcsync_test.go +++ b/pkg/applicationserver/io/packages/alcsync/v1/alcsync_test.go @@ -137,7 +137,6 @@ func TestNewTimeSyncCommand(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -205,7 +204,6 @@ func TestMakeCommandValidInput(t *testing.T) { var fPort uint32 for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -273,7 +271,6 @@ func TestMakeCommandInvalidInput(t *testing.T) { var fPort uint32 for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -467,7 +464,6 @@ func TestMakeCommandsValidInput(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -589,7 +585,6 @@ func TestMakeDownlinkSerializesAppTimeAns(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) diff --git a/pkg/applicationserver/io/packages/alcsync/v1/data_test.go b/pkg/applicationserver/io/packages/alcsync/v1/data_test.go index 1b04b294bc..f869dc1b43 100644 --- a/pkg/applicationserver/io/packages/alcsync/v1/data_test.go +++ b/pkg/applicationserver/io/packages/alcsync/v1/data_test.go @@ -66,7 +66,6 @@ func TestPackageDataHandlesInvalidValues(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -222,7 +221,6 @@ func TestPackageDataMerge(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) diff --git a/pkg/applicationserver/io/packages/alcsync/v1/timesync_test.go b/pkg/applicationserver/io/packages/alcsync/v1/timesync_test.go index 1436846c70..6ad1bc6585 100644 --- a/pkg/applicationserver/io/packages/alcsync/v1/timesync_test.go +++ b/pkg/applicationserver/io/packages/alcsync/v1/timesync_test.go @@ -106,7 +106,6 @@ func TestTimeSynchronizationCommandCalculatesCorrection(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -171,7 +170,6 @@ func TestTimeSynchronizationCommandRespectsThreshold(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) @@ -231,7 +229,6 @@ func TestTimeSynchronizationCommandRespectsAnsRequired(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, _ := test.New(t) diff --git a/pkg/applicationserver/io/packages/loragls/v3/data_test.go b/pkg/applicationserver/io/packages/loragls/v3/data_test.go index 3ff60673b8..aed1abcb18 100644 --- a/pkg/applicationserver/io/packages/loragls/v3/data_test.go +++ b/pkg/applicationserver/io/packages/loragls/v3/data_test.go @@ -153,7 +153,6 @@ func TestPackageDataDeserialization(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() data := &Data{} @@ -219,7 +218,6 @@ func TestPackageDataSerialization(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -320,7 +318,6 @@ func TestPackageDataMerge(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -374,7 +371,6 @@ func TestPackageDataValidation(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/auth/rights/rights_test.go b/pkg/auth/rights/rights_test.go index 286ac0f5fe..efec82585c 100644 --- a/pkg/auth/rights/rights_test.go +++ b/pkg/auth/rights/rights_test.go @@ -219,7 +219,6 @@ func TestMap(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a.So(tc.Assertion(t, tc.Rights, tc.NewMap(t, tc.Rights)), should.BeTrue) diff --git a/pkg/band/band_test.go b/pkg/band/band_test.go index 00f192e8cc..d553953eb3 100644 --- a/pkg/band/band_test.go +++ b/pkg/band/band_test.go @@ -1426,7 +1426,6 @@ func TestGenerateChMask(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -1542,7 +1541,6 @@ func TestCompareDatarates(t *testing.T) { Expected: false, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1832,7 +1830,6 @@ func TestChannelsWellDefined(t *testing.T) { for name, versions := range All { for version, b := range versions { - b := b t.Run(fmt.Sprintf("%v/%v", name, version), func(t *testing.T) { t.Parallel() @@ -1859,7 +1856,6 @@ func TestSubBandsWellDefined(t *testing.T) { for name, versions := range All { for version, b := range versions { - b := b t.Run(fmt.Sprintf("%v/%v", name, version), func(t *testing.T) { t.Parallel() diff --git a/pkg/band/reference_test.go b/pkg/band/reference_test.go index f8ca6ccd1a..3bfbcb8de9 100644 --- a/pkg/band/reference_test.go +++ b/pkg/band/reference_test.go @@ -235,7 +235,6 @@ func TestBandDefinitions(t *testing.T) { t.Parallel() for name, versions := range band.All { for version, b := range versions { - version, b := version, b t.Run(fmt.Sprintf("%v/%v", name, version), func(t *testing.T) { t.Parallel() testBand(t, makeBand(b), version) @@ -248,7 +247,6 @@ func TestLatest(t *testing.T) { t.Parallel() for name := range band.All { - name := name t.Run(name, func(t *testing.T) { t.Parallel() if _, ok := band.LatestVersion[name]; !ok { @@ -258,7 +256,6 @@ func TestLatest(t *testing.T) { } for name := range band.LatestVersion { - name := name t.Run(name, func(t *testing.T) { t.Parallel() if _, ok := band.All[name]; !ok { diff --git a/pkg/band/rpc_test.go b/pkg/band/rpc_test.go index e35853c5d3..1d20ea90d8 100644 --- a/pkg/band/rpc_test.go +++ b/pkg/band/rpc_test.go @@ -376,8 +376,6 @@ func TestGetPhyVersions(t *testing.T) { }, }, } { - tc := tc - t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -772,8 +770,6 @@ func TestBandConvertToBandDescription(t *testing.T) { }, }, } { - tc := tc - t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -888,7 +884,6 @@ func TestListBands(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/band/shared_test.go b/pkg/band/shared_test.go index 33bfd69f3b..1959d77776 100644 --- a/pkg/band/shared_test.go +++ b/pkg/band/shared_test.go @@ -28,9 +28,7 @@ import ( func TestRelaySharedParameters(t *testing.T) { t.Parallel() for name, versions := range band.All { - name := name for version, phy := range versions { - version, phy := version, phy t.Run(fmt.Sprintf("%v/%v", name, version), func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/basicstation/cups/server_test.go b/pkg/basicstation/cups/server_test.go index b44ce1e572..8eb6106d8d 100644 --- a/pkg/basicstation/cups/server_test.go +++ b/pkg/basicstation/cups/server_test.go @@ -562,7 +562,6 @@ func TestServer(t *testing.T) { //nolint:gocyclo }, }, } { - tt := tt t.Run(tt.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/crypto/cryptoutil/cryptoutil_test.go b/pkg/crypto/cryptoutil/cryptoutil_test.go index e42b267fb8..90b96d9e06 100644 --- a/pkg/crypto/cryptoutil/cryptoutil_test.go +++ b/pkg/crypto/cryptoutil/cryptoutil_test.go @@ -67,7 +67,6 @@ func TestWrapAES128Key(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -107,7 +106,6 @@ func TestWrapAES128Key(t *testing.T) { ExpectedError: errors.IsInvalidArgument, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -496,7 +494,6 @@ func TestUnwrapSelectedSessionKeys(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/crypto/cryptoutil/kek_labelers_test.go b/pkg/crypto/cryptoutil/kek_labelers_test.go index d2839e2d7f..1280a3d700 100644 --- a/pkg/crypto/cryptoutil/kek_labelers_test.go +++ b/pkg/crypto/cryptoutil/kek_labelers_test.go @@ -122,7 +122,6 @@ func TestComponentPrefixKEKLabeler(t *testing.T) { Expected: "ns/12.34.56.78", }, } { - tc := tc t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/crypto/hmachash_test.go b/pkg/crypto/hmachash_test.go index 36c5395110..eeecaaeb75 100644 --- a/pkg/crypto/hmachash_test.go +++ b/pkg/crypto/hmachash_test.go @@ -59,7 +59,6 @@ func TestHMACHash(t *testing.T) { Payload: []byte("-----BEGIN EC PRIVATE KEY-----MHcCAQEEIBVXljefOUPY++0sovcF0dboOLEJz4eZ9DoUE8o9Y7GHoAoGCCqGSM49AwEHoUQDQgAEjf3zZPXlc/sseTt7YzF0o61feXvk98JFyy+s/j0gzMzUjEka7+WzTPERi9uMQjERns1qXG/9DJLe/Qxi0r84hA==-----END EC PRIVATE KEY-----"), //nolint:lll }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() key := types.AES128Key{ diff --git a/pkg/deviceclaimingserver/grpc_end_devices_test.go b/pkg/deviceclaimingserver/grpc_end_devices_test.go index 87c211d4f0..9a972e06af 100644 --- a/pkg/deviceclaimingserver/grpc_end_devices_test.go +++ b/pkg/deviceclaimingserver/grpc_end_devices_test.go @@ -269,7 +269,6 @@ func TestEndDeviceClaimingServer(t *testing.T) { CallOpts: authorizedCallOpt, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() _, err := edcsClient.Claim(ctx, tc.Req, tc.CallOpts) @@ -790,7 +789,6 @@ func TestBatchOperations(t *testing.T) { // nolint:all }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { mockEndDeviceClaimer.BatchUnclaimFunc = tc.BatchUnclaimFunc ret, err := edcsClient.Unclaim(ctx, tc.Req, tc.CallOpts) diff --git a/pkg/deviceclaimingserver/grpc_gateways_test.go b/pkg/deviceclaimingserver/grpc_gateways_test.go index 2abf729324..1e18df9adb 100644 --- a/pkg/deviceclaimingserver/grpc_gateways_test.go +++ b/pkg/deviceclaimingserver/grpc_gateways_test.go @@ -351,7 +351,6 @@ func TestGatewayClaimingServer(t *testing.T) { //nolint:paralleltest CallOpt: authorizedCallOpt, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { if tc.ClaimFunc != nil { mockGatewayClaimer.ClaimFunc = tc.ClaimFunc @@ -477,7 +476,6 @@ func TestGatewayClaimingServer(t *testing.T) { //nolint:paralleltest CallOpt: authorizedCallOpt, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { if tc.UnclaimFunc != nil { mockGatewayClaimer.UnclaimFunc = tc.UnclaimFunc diff --git a/pkg/devicetemplateconverter/profilefetcher/vendor_profile_fetcher_test.go b/pkg/devicetemplateconverter/profilefetcher/vendor_profile_fetcher_test.go index 81f8ff4f92..4aed8d9cab 100644 --- a/pkg/devicetemplateconverter/profilefetcher/vendor_profile_fetcher_test.go +++ b/pkg/devicetemplateconverter/profilefetcher/vendor_profile_fetcher_test.go @@ -52,7 +52,6 @@ func Test_VendorIDProfileFetcher_ShouldFetchProfile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -128,7 +127,6 @@ func Test_VendorIDProfileFetcher_FetchProfile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/devicetemplateconverter/profilefetcher/version_profile_fetcher_test.go b/pkg/devicetemplateconverter/profilefetcher/version_profile_fetcher_test.go index 6fc9871d89..acb6c6b073 100644 --- a/pkg/devicetemplateconverter/profilefetcher/version_profile_fetcher_test.go +++ b/pkg/devicetemplateconverter/profilefetcher/version_profile_fetcher_test.go @@ -55,7 +55,6 @@ func Test_VersionIDProfileFetcher_ShouldFetchProfile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -143,7 +142,6 @@ func Test_VersionIDProfileFetcher_FetchProfile(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/devicetemplates/ttscsv_test.go b/pkg/devicetemplates/ttscsv_test.go index 6ea0e96894..73815d1a75 100644 --- a/pkg/devicetemplates/ttscsv_test.go +++ b/pkg/devicetemplates/ttscsv_test.go @@ -342,7 +342,6 @@ func TestTTSCSVConverter(t *testing.T) { nExpect: 1, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/email/email_test.go b/pkg/email/email_test.go index 15a98a5769..b2ed9c8cef 100644 --- a/pkg/email/email_test.go +++ b/pkg/email/email_test.go @@ -57,7 +57,6 @@ func TestEmail(t *testing.T) { returnedTemplate := registry.GetTemplate(ctx, ttnpb.GetNotificationTypeString(ttnpb.NotificationType_UNKNOWN)) for i, template := range []*email.Template{welcomeEmailTemplate, returnedTemplate} { - template := template t.Run(fmt.Sprint(i), func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/email/templates/templates_test.go b/pkg/email/templates/templates_test.go index 72e3231b6f..c04fc5791b 100644 --- a/pkg/email/templates/templates_test.go +++ b/pkg/email/templates/templates_test.go @@ -104,7 +104,6 @@ func TestEmailTemplates(t *testing.T) { }, }, } { - tc := tc t.Run(tc.TemplateName, func(t *testing.T) { t.Parallel() a, ctx := test.New(t) diff --git a/pkg/encoding/lorawan/relay_test.go b/pkg/encoding/lorawan/relay_test.go index ce9af13ced..139500da04 100644 --- a/pkg/encoding/lorawan/relay_test.go +++ b/pkg/encoding/lorawan/relay_test.go @@ -104,7 +104,6 @@ func TestMarshalRelayForwardUplinkReq(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/errors/attributes_test.go b/pkg/errors/attributes_test.go index cfef5b18ae..a9cda4e8bd 100644 --- a/pkg/errors/attributes_test.go +++ b/pkg/errors/attributes_test.go @@ -63,7 +63,6 @@ func TestAttributes(t *testing.T) { } for _, tc := range tcs { - tc := tc // shadow range variable. t.Run(tc.Name, func(t *testing.T) { t.Parallel() assertions.New(t).So(errors.Supported(tc.V), should.Equal, tc.Expect) diff --git a/pkg/errors/errors_test.go b/pkg/errors/errors_test.go index c755e022dc..7f37dbc6f0 100644 --- a/pkg/errors/errors_test.go +++ b/pkg/errors/errors_test.go @@ -223,7 +223,6 @@ func TestNetErrors(t *testing.T) { }, }, } { - tc := tc // shadow range variable. t.Run(tc.Name, func(t *testing.T) { t.Parallel() err, ok := errors.From(tc.Error) diff --git a/pkg/events/mux/mux.go b/pkg/events/mux/mux.go index 6c5a5be97d..6cd838e4b8 100644 --- a/pkg/events/mux/mux.go +++ b/pkg/events/mux/mux.go @@ -145,7 +145,6 @@ func (m *multiplexerStore) fromSubscribers( group, ctx := errgroup.WithContext(ctx) res := make(chan []events.Event, len(subs)) for _, ps := range subs { - ps := ps ctx := log.NewContextWithField(ctx, "events_mux_subscription_type", m.subscriberType(ps)) group.Go(func() error { evts, err := f(ctx, ps) diff --git a/pkg/events/redis/store.go b/pkg/events/redis/store.go index 069bd68206..d55e064a86 100644 --- a/pkg/events/redis/store.go +++ b/pkg/events/redis/store.go @@ -405,7 +405,6 @@ func (ps *PubSubStore) SubscribeWithHistory( defer wg.Wait() ctx, cancel := errorcontext.New(ctx) for _, states := range partitionStreamStates(states, ps.streamPartitionSize) { - states := states f := func(ctx context.Context) (err error) { defer func() { cancel(err) }() return ps.iterateStreamPartition(ctx, states, eventCountLimit, ch) diff --git a/pkg/gatewayconfigurationserver/managed/client/client.go b/pkg/gatewayconfigurationserver/managed/client/client.go index 02814e9ba4..b925ffce74 100644 --- a/pkg/gatewayconfigurationserver/managed/client/client.go +++ b/pkg/gatewayconfigurationserver/managed/client/client.go @@ -67,7 +67,6 @@ func (c *client) subscribeEventData( ctx, cancel := context.WithCancel(ctx) wg, ctx := errgroup.WithContext(ctx) for _, gtwID := range ids { - gtwID := gtwID stream, err := client.StreamEvents(ctx, gtwID, callOpt) if err != nil { cancel() diff --git a/pkg/gatewayserver/gatewayserver.go b/pkg/gatewayserver/gatewayserver.go index a5f361e450..55287d9a6b 100644 --- a/pkg/gatewayserver/gatewayserver.go +++ b/pkg/gatewayserver/gatewayserver.go @@ -234,8 +234,6 @@ func New(c *component.Component, conf *Config, opts ...Option) (gs *GatewayServe // Start UDP listeners. for addr, fallbackFrequencyPlanID := range conf.UDP.Listeners { - addr := addr - fallbackFrequencyPlanID := fallbackFrequencyPlanID gs.RegisterTask(&task.Config{ Context: gs.Context(), ID: fmt.Sprintf("serve_udp/%s", addr), @@ -340,7 +338,6 @@ func New(c *component.Component, conf *Config, opts ...Option) (gs *GatewayServe component.NewTCPEndpoint(version.Listen, version.Name), component.NewTLSEndpoint(version.ListenTLS, version.Name, tlsconfig.WithNextProtos("h2", "http/1.1")), } { - endpoint := endpoint if endpoint.Address() == "" { continue } @@ -399,7 +396,6 @@ func New(c *component.Component, conf *Config, opts ...Option) (gs *GatewayServe tlsconfig.WithNextProtos("h2", "http/1.1"), ), } { - endpoint := endpoint if endpoint.Address() == "" { continue } diff --git a/pkg/gatewayserver/io/io_internal_test.go b/pkg/gatewayserver/io/io_internal_test.go index 676bb4acea..7275e70e2b 100644 --- a/pkg/gatewayserver/io/io_internal_test.go +++ b/pkg/gatewayserver/io/io_internal_test.go @@ -119,7 +119,6 @@ func TestIsRepeatedUplink(t *testing.T) { repeated: false, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/gatewayserver/io/iotest/iotest.go b/pkg/gatewayserver/io/iotest/iotest.go index eec47e5248..6aaad8115c 100644 --- a/pkg/gatewayserver/io/iotest/iotest.go +++ b/pkg/gatewayserver/io/iotest/iotest.go @@ -238,7 +238,6 @@ func Frontend(t *testing.T, frontend FrontendConfig) { //nolint:gocyclo ID: &ttnpb.GatewayIdentifiers{Eui: unregisteredGatewayEUI.Bytes()}, }, } { - ctc := ctc t.Run(ctc.Name, func(t *testing.T) { ctx, cancel := context.WithCancel(ctx) upCh := make(chan *ttnpb.GatewayUp) @@ -251,7 +250,6 @@ func Frontend(t *testing.T, frontend FrontendConfig) { //nolint:gocyclo defer test.SetDefaultEventsPubSub(&test.MockEventPubSub{ //nolint:revive PublishFunc: func(evs ...events.Event) { for _, ev := range evs { - ev := ev switch name := ev.Name(); name { case "gs.gateway.connect": go func() { @@ -478,7 +476,6 @@ func Frontend(t *testing.T, frontend FrontendConfig) { //nolint:gocyclo defer test.SetDefaultEventsPubSub(&test.MockEventPubSub{ //nolint:revive PublishFunc: func(evs ...events.Event) { for _, ev := range evs { - ev := ev t.Logf("%s event published", ev.Name()) switch name := ev.Name(); name { case "gs.gateway.connect": @@ -570,7 +567,6 @@ func Frontend(t *testing.T, frontend FrontendConfig) { //nolint:gocyclo defer test.SetDefaultEventsPubSub(&test.MockEventPubSub{ //nolint:revive PublishFunc: func(evs ...events.Event) { for _, ev := range evs { - ev := ev t.Logf("%s event published", ev.Name()) switch name := ev.Name(); name { case "gs.gateway.connect": @@ -710,7 +706,6 @@ func Frontend(t *testing.T, frontend FrontendConfig) { //nolint:gocyclo defer test.SetDefaultEventsPubSub(&test.MockEventPubSub{ //nolint:revive PublishFunc: func(evs ...events.Event) { for _, ev := range evs { - ev := ev switch name := ev.Name(); name { case "gs.gateway.connect": go func() { @@ -1153,7 +1148,6 @@ func Frontend(t *testing.T, frontend FrontendConfig) { //nolint:gocyclo defer test.SetDefaultEventsPubSub(&test.MockEventPubSub{ //nolint:revive PublishFunc: func(evs ...events.Event) { for _, ev := range evs { - ev := ev switch name := ev.Name(); name { case "gs.up.receive", "gs.down.tx.success", "gs.down.tx.fail", "gs.status.receive", "gs.io.up.repeat": go func() { diff --git a/pkg/gatewayserver/io/semtechws/lbslns/discover_test.go b/pkg/gatewayserver/io/semtechws/lbslns/discover_test.go index da5ec20740..6cb1846ef1 100644 --- a/pkg/gatewayserver/io/semtechws/lbslns/discover_test.go +++ b/pkg/gatewayserver/io/semtechws/lbslns/discover_test.go @@ -65,7 +65,6 @@ func TestDiscover(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/gatewayserver/io/semtechws/lbslns/upstream_test.go b/pkg/gatewayserver/io/semtechws/lbslns/upstream_test.go index 7a67dac058..802c76859a 100644 --- a/pkg/gatewayserver/io/semtechws/lbslns/upstream_test.go +++ b/pkg/gatewayserver/io/semtechws/lbslns/upstream_test.go @@ -106,7 +106,6 @@ func TestMarshalJSON(t *testing.T) { Expected: []byte(`{"msgtype":"timesync","txtime":123.456}`), }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -240,7 +239,6 @@ func TestJoinRequest(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -422,7 +420,6 @@ func TestUplinkDataFrame(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -535,7 +532,6 @@ func TestFromUplinkDataFrame(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -631,7 +627,6 @@ func TestJreqFromUplinkDataFrame(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/gatewayserver/io/semtechws/time_test.go b/pkg/gatewayserver/io/semtechws/time_test.go index e857660c13..1f558b9420 100644 --- a/pkg/gatewayserver/io/semtechws/time_test.go +++ b/pkg/gatewayserver/io/semtechws/time_test.go @@ -58,7 +58,6 @@ func TestTimePtrFromUpInfo(t *testing.T) { ExpectedTime: timePtr(time.Unix(315964923, 456000000).UTC()), }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/gatewayserver/scheduling/clock_test.go b/pkg/gatewayserver/scheduling/clock_test.go index a9c7c9087c..96422237eb 100644 --- a/pkg/gatewayserver/scheduling/clock_test.go +++ b/pkg/gatewayserver/scheduling/clock_test.go @@ -126,7 +126,6 @@ func TestRolloverClock(t *testing.T) { sessionID int64 ) for i, xtimeIn := range timestamps { - xtimeIn := xtimeIn diff := int64(0) if prev != nil { diff = xtimeIn - *prev @@ -195,7 +194,6 @@ func TestIssue2581(t *testing.T) { sessionID int64 ) for i, xtimeIn := range timestamps { - xtimeIn := xtimeIn diff := int64(0) if prev != nil { diff = xtimeIn - *prev diff --git a/pkg/goproto/validate_test.go b/pkg/goproto/validate_test.go index ff365a3faa..6ab54017ed 100644 --- a/pkg/goproto/validate_test.go +++ b/pkg/goproto/validate_test.go @@ -90,7 +90,6 @@ func TestValidateStruct(t *testing.T) { }, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/gpstime/gpstime_test.go b/pkg/gpstime/gpstime_test.go index d36cbe9dd3..c9409a1631 100644 --- a/pkg/gpstime/gpstime_test.go +++ b/pkg/gpstime/gpstime_test.go @@ -128,7 +128,6 @@ func TestGPSConversion(t *testing.T) { Time: epoch.Add(leap5 - 3*time.Second), }, } { - tc := tc t.Run(fmt.Sprintf("%d/Time:%s/UnixNano:%d/GPS:%d", i, tc.Time, tc.Time.UnixNano(), tc.GPS), func(t *testing.T) { t.Parallel() diff --git a/pkg/identityserver/email.go b/pkg/identityserver/email.go index 3a6efbe1ff..0ec079d34c 100644 --- a/pkg/identityserver/email.go +++ b/pkg/identityserver/email.go @@ -74,7 +74,6 @@ func (is *IdentityServer) SendTemplateEmailToUsers( var wg errgroup.Group for _, receiver := range receivers { - receiver := receiver // shadow range variable. wg.Go(func() error { templateData, err := dataBuilder( ctx, @@ -101,7 +100,6 @@ func (is *IdentityServer) SendNotificationEmailToUsers(ctx context.Context, noti var wg errgroup.Group for _, receiver := range receivers { - receiver := receiver // shadow range variable. // Skips over the possible `support` user. // This user can only be created via the API endpoints defined in the tenant access service. diff --git a/pkg/identityserver/gateway_access_test.go b/pkg/identityserver/gateway_access_test.go index ab7bf70478..e4e4b3ae9a 100644 --- a/pkg/identityserver/gateway_access_test.go +++ b/pkg/identityserver/gateway_access_test.go @@ -1203,7 +1203,6 @@ func TestGatewayBatchAccess(t *testing.T) { Credentials: dualMembershipUserCreds, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { is.config.AdminRights.All = !tc.LimitedAdminRights diff --git a/pkg/identityserver/notification_registry_test.go b/pkg/identityserver/notification_registry_test.go index 4dc519dbae..a2aace9392 100644 --- a/pkg/identityserver/notification_registry_test.go +++ b/pkg/identityserver/notification_registry_test.go @@ -132,9 +132,7 @@ func TestNotificationRegistryWithOrganizationFanout(t *testing.T) { // Register users as collaborators on both organizations. for _, org := range []*ttnpb.Organization{org1, org2} { - org := org for _, collab := range []*ttnpb.User{usr2, usr3} { - collab := collab p.NewMembership( collab.GetOrganizationOrUserIdentifiers(), org.GetEntityIdentifiers(), @@ -156,7 +154,6 @@ func TestNotificationRegistryWithOrganizationFanout(t *testing.T) { app1.GetIds().GetEntityIdentifiers(), app2.GetIds().GetEntityIdentifiers(), } { - entityID := entityID res, err := svc.Create(ctx, &ttnpb.CreateNotificationRequest{ EntityIds: entityID, NotificationType: ttnpb.GetNotificationTypeString(ttnpb.NotificationType_UNKNOWN), @@ -180,7 +177,6 @@ func TestNotificationRegistryWithOrganizationFanout(t *testing.T) { {userID: usr2.GetIds(), notificationAmount: 1, creds: usr2Creds}, {userID: usr3.GetIds(), notificationAmount: 1, creds: usr3Creds}, } { - tt := tt ttName := fmt.Sprintf("Expect %s to have %d notifications", tt.userID.GetUserId(), tt.notificationAmount) t.Run(ttName, func(t *testing.T) { // nolint:paralleltest a, ctx := test.New(t) diff --git a/pkg/identityserver/storetest/end_device_store.go b/pkg/identityserver/storetest/end_device_store.go index 03e75176dc..2ffee5b73b 100644 --- a/pkg/identityserver/storetest/end_device_store.go +++ b/pkg/identityserver/storetest/end_device_store.go @@ -836,7 +836,6 @@ func (st *StoreTest) TestEndDeviceBatchOperations(t *T) { // nolint:gocyclo }, }, } { - tc := tc t.Run(tc.Name, func(t *T) { a := assertions.New(t) deleted, err := s.BatchDeleteEndDevices(tc.Context, tc.ApplicationIDs, tc.DeviceIDs) diff --git a/pkg/identityserver/storetest/gateway_store.go b/pkg/identityserver/storetest/gateway_store.go index c9389e80d6..5710057c36 100644 --- a/pkg/identityserver/storetest/gateway_store.go +++ b/pkg/identityserver/storetest/gateway_store.go @@ -651,7 +651,6 @@ func (st *StoreTest) TestGatewayBatchOperations(t *T) { // nolint:gocyclo }, }, } { - tc := tc t.Run(tc.Name, func(t *T) { a := assertions.New(t) deleted, err := s.BatchDeleteGateways(tc.Context, tc.Request) diff --git a/pkg/interop/client_test.go b/pkg/interop/client_test.go index 7d1aad609f..78173a601c 100644 --- a/pkg/interop/client_test.go +++ b/pkg/interop/client_test.go @@ -239,7 +239,6 @@ func TestGetAppSKey(t *testing.T) { //nolint:paralleltest }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { a := assertions.New(t) @@ -655,7 +654,6 @@ func TestHandleJoinRequest(t *testing.T) { //nolint:paralleltest }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { a := assertions.New(t) @@ -832,7 +830,6 @@ func TestJoinServerRace(t *testing.T) { //nolint:paralleltest }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { a := assertions.New(t) diff --git a/pkg/interop/server_test.go b/pkg/interop/server_test.go index c3f0ae0e4c..f97f7d37bd 100644 --- a/pkg/interop/server_test.go +++ b/pkg/interop/server_test.go @@ -307,7 +307,6 @@ func TestServer(t *testing.T) { //nolint:gocyclo }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/joinserver/grpc_application_activation_settings_registry_test.go b/pkg/joinserver/grpc_application_activation_settings_registry_test.go index efd477998e..8f57ede388 100644 --- a/pkg/joinserver/grpc_application_activation_settings_registry_test.go +++ b/pkg/joinserver/grpc_application_activation_settings_registry_test.go @@ -189,7 +189,6 @@ func TestApplicationActivationSettingRegistryServer(t *testing.T) { }, }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: fmt.Sprintf("Get errors/%s", tc.Name), Parallel: true, @@ -325,7 +324,6 @@ func TestApplicationActivationSettingRegistryServer(t *testing.T) { }, }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: fmt.Sprintf("Set errors/%s", tc.Name), Parallel: true, @@ -405,7 +403,6 @@ func TestApplicationActivationSettingRegistryServer(t *testing.T) { }, }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: fmt.Sprintf("Delete errors/%s", tc.Name), Parallel: true, @@ -452,7 +449,6 @@ func TestApplicationActivationSettingRegistryServer(t *testing.T) { }, }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: fmt.Sprintf("Flow/%s", tc.Name), Parallel: true, diff --git a/pkg/joinserver/grpc_deviceregistry_test.go b/pkg/joinserver/grpc_deviceregistry_test.go index 6e38979255..0582ca505b 100644 --- a/pkg/joinserver/grpc_deviceregistry_test.go +++ b/pkg/joinserver/grpc_deviceregistry_test.go @@ -1440,7 +1440,6 @@ func TestDeviceRegistryBatchDelete(t *testing.T) { // nolint:paralleltest BatchDeleteKeysCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/joinserver/joinserver_test.go b/pkg/joinserver/joinserver_test.go index 67da3fa282..02e62bf93c 100644 --- a/pkg/joinserver/joinserver_test.go +++ b/pkg/joinserver/joinserver_test.go @@ -132,7 +132,6 @@ func TestInvalidJoinRequests(t *testing.T) { Assertion: errors.IsInvalidArgument, }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -2387,7 +2386,6 @@ func TestHandleJoin(t *testing.T) { ErrorAssertion: errors.IsInvalidArgument, }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -2741,7 +2739,6 @@ func TestGetNwkSKeys(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -3154,7 +3151,6 @@ func TestGetAppSKey(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -3254,7 +3250,6 @@ func TestGetHomeNetID(t *testing.T) { ResponseNetID: &types.NetID{0x42, 0xff, 0xff}, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/joinserver/registry_test.go b/pkg/joinserver/registry_test.go index a00424f068..7787ba0d2e 100644 --- a/pkg/joinserver/registry_test.go +++ b/pkg/joinserver/registry_test.go @@ -329,7 +329,6 @@ func TestDeviceRegistries(t *testing.T) { N: 8, }, } { - tc := tc for i := 0; i < int(tc.N); i++ { test.RunSubtest(t, test.SubtestConfig{ Name: fmt.Sprintf("%s/%d", tc.Name, i), @@ -633,7 +632,6 @@ func TestSessionKeyRegistries(t *testing.T) { N: 8, }, } { - tc := tc for i := 0; i < int(tc.N); i++ { test.RunSubtest(t, test.SubtestConfig{ Name: fmt.Sprintf("%s/%d", tc.Name, i), diff --git a/pkg/messageprocessors/normalizedpayload/uplink_test.go b/pkg/messageprocessors/normalizedpayload/uplink_test.go index 0b000029d1..a12a33ac2e 100644 --- a/pkg/messageprocessors/normalizedpayload/uplink_test.go +++ b/pkg/messageprocessors/normalizedpayload/uplink_test.go @@ -728,7 +728,6 @@ func TestUplink(t *testing.T) { }, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/networkserver/downlink_internal_test.go b/pkg/networkserver/downlink_internal_test.go index 4f1b03954e..2f496ca7f6 100644 --- a/pkg/networkserver/downlink_internal_test.go +++ b/pkg/networkserver/downlink_internal_test.go @@ -134,7 +134,6 @@ func TestAppendRecentDownlink(t *testing.T) { Expected: downs[1:3], }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: fmt.Sprintf("recent_length:%d,window:%v", len(tc.Recent), tc.Window), Parallel: true, @@ -1190,7 +1189,6 @@ func TestGenerateDataDownlink(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/downlink_test.go b/pkg/networkserver/downlink_test.go index 9d9e1a8388..1002a67200 100644 --- a/pkg/networkserver/downlink_test.go +++ b/pkg/networkserver/downlink_test.go @@ -103,7 +103,6 @@ func TestProcessDownlinkTask(t *testing.T) { ) } else { for i, ids := range DefaultClassBCGatewayIdentifiers { - ids := ids downlinkPaths = append(downlinkPaths, DownlinkPath{ GatewayIdentifiers: ids.GatewayIds, DownlinkPath: &ttnpb.DownlinkPath{ @@ -121,8 +120,6 @@ func TestProcessDownlinkTask(t *testing.T) { var lastDown *ttnpb.DownlinkMessage var asserts []func(ctx, reqCtx context.Context, msg *ttnpb.DownlinkMessage) (NsGsScheduleDownlinkResponse, bool) for i, resp := range resps { - i := i - resp := resp asserts = append(asserts, func(ctx, reqCtx context.Context, msg *ttnpb.DownlinkMessage) (NsGsScheduleDownlinkResponse, bool) { lastDown = msg _, a := test.MustNewTFromContext(ctx) @@ -2554,7 +2551,6 @@ func TestProcessDownlinkTask(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Func: func(ctx context.Context, t *testing.T, a *assertions.Assertion) { diff --git a/pkg/networkserver/grpc_asns_test.go b/pkg/networkserver/grpc_asns_test.go index a9374024a7..6d15004927 100644 --- a/pkg/networkserver/grpc_asns_test.go +++ b/pkg/networkserver/grpc_asns_test.go @@ -685,7 +685,6 @@ func TestDownlinkQueueReplace(t *testing.T) { SetByIDCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -1281,7 +1280,6 @@ func TestDownlinkQueuePush(t *testing.T) { SetByIDCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -1519,7 +1517,6 @@ func TestDownlinkQueueList(t *testing.T) { GetByIDCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/grpc_deviceregistry.go b/pkg/networkserver/grpc_deviceregistry.go index 0742884dc8..5717091a27 100644 --- a/pkg/networkserver/grpc_deviceregistry.go +++ b/pkg/networkserver/grpc_deviceregistry.go @@ -527,7 +527,6 @@ func (ns *NetworkServer) Set(ctx context.Context, req *ttnpb.SetEndDeviceRequest return st.Device.Session.Keys.GetSNwkSIntKey() != nil && st.Device.Session.Keys.SNwkSIntKey.IsZero() }, } { - p, isZero := p, isZero if err := st.ValidateSetField(func() bool { return !isZero() }, p); err != nil { return nil, err } @@ -592,7 +591,6 @@ func (ns *NetworkServer) Set(ctx context.Context, req *ttnpb.SetEndDeviceRequest return len(st.Device.PendingSession.Keys.GetSessionKeyId()) == 0 }, } { - p, isZero := p, isZero if err := st.ValidateSetField(func() bool { return !isZero() }, p); err != nil { return nil, err } @@ -660,7 +658,6 @@ func (ns *NetworkServer) Set(ctx context.Context, req *ttnpb.SetEndDeviceRequest st.Device.PendingMacState.QueuedJoinAccept.DevAddr, ).OrZero().IsZero, } { - p, isZero := p, isZero if err := st.ValidateSetField(func() bool { return !isZero() }, p); err != nil { return nil, err } diff --git a/pkg/networkserver/grpc_deviceregistry_test.go b/pkg/networkserver/grpc_deviceregistry_test.go index 1564b1c8b9..3aa36c2e4b 100644 --- a/pkg/networkserver/grpc_deviceregistry_test.go +++ b/pkg/networkserver/grpc_deviceregistry_test.go @@ -321,7 +321,6 @@ func TestDeviceRegistryGet(t *testing.T) { GetByIDCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -1502,7 +1501,6 @@ func TestDeviceRegistryDelete(t *testing.T) { SetCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -2004,7 +2002,6 @@ func TestDeviceRegistryBatchDelete(t *testing.T) { // nolint:paralleltest SetCalls: 3, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/grpc_gsns_internal_test.go b/pkg/networkserver/grpc_gsns_internal_test.go index 0318dc935b..69c42b0e3f 100644 --- a/pkg/networkserver/grpc_gsns_internal_test.go +++ b/pkg/networkserver/grpc_gsns_internal_test.go @@ -103,7 +103,6 @@ func TestAppendRecentUplink(t *testing.T) { Expected: ups[1:3], }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: fmt.Sprintf("recent_length:%d,window:%v", len(tc.Recent), tc.Window), Parallel: true, diff --git a/pkg/networkserver/grpc_mac_settings_profile_test.go b/pkg/networkserver/grpc_mac_settings_profile_test.go index 12c5ef2da9..74f70a0ace 100644 --- a/pkg/networkserver/grpc_mac_settings_profile_test.go +++ b/pkg/networkserver/grpc_mac_settings_profile_test.go @@ -210,7 +210,6 @@ func TestMACSettingsProfileRegistryGet(t *testing.T) { GetCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -434,7 +433,6 @@ func TestMACSettingsProfileRegistryCreate(t *testing.T) { SetCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -705,7 +703,6 @@ func TestMACSettingsProfileRegistryUpdate(t *testing.T) { SetCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -990,7 +987,6 @@ func TestMACSettingsProfileRegistryDelete(t *testing.T) { SetCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -1273,7 +1269,6 @@ func TestMACSettingsProfileRegistryList(t *testing.T) { PaginationCalls: 1, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/grpc_test.go b/pkg/networkserver/grpc_test.go index 86148e81c5..4158d0df23 100644 --- a/pkg/networkserver/grpc_test.go +++ b/pkg/networkserver/grpc_test.go @@ -60,7 +60,6 @@ func TestGenerateDevAddr(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -166,7 +165,6 @@ func TestGenerateDevAddr(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -252,7 +250,6 @@ func TestGetDefaultMACSettings(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.name, Parallel: true, diff --git a/pkg/networkserver/internal/utils.go b/pkg/networkserver/internal/utils.go index 3d09fd1f1e..6214b78c80 100644 --- a/pkg/networkserver/internal/utils.go +++ b/pkg/networkserver/internal/utils.go @@ -52,7 +52,6 @@ var LoRaWANBands = func() map[string]map[ttnpb.PHYVersion]*band.Band { for id, vers := range band.All { m := make(map[ttnpb.PHYVersion]*band.Band, len(vers)) for ver, b := range vers { - b := b m[ver] = &b } bands[id] = m diff --git a/pkg/networkserver/mac/adr_param_setup_test.go b/pkg/networkserver/mac/adr_param_setup_test.go index 4b6cb29d66..9b9a8cced2 100644 --- a/pkg/networkserver/mac/adr_param_setup_test.go +++ b/pkg/networkserver/mac/adr_param_setup_test.go @@ -172,7 +172,6 @@ func TestNeedsADRParamSetupReq(t *testing.T) { }) for _, tc := range tcs { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -245,7 +244,6 @@ func TestHandleADRParamSetupAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/adr_test.go b/pkg/networkserver/mac/adr_test.go index 6ecb5d250f..7b30a2e9d9 100644 --- a/pkg/networkserver/mac/adr_test.go +++ b/pkg/networkserver/mac/adr_test.go @@ -269,7 +269,6 @@ func TestAdaptDataRate(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -372,7 +371,6 @@ func TestIssue458(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -509,7 +507,6 @@ func TestADRLossRate(t *testing.T) { Rate: 1. / 3., }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: strings.Join(func() (ss []string) { for _, up := range tc.Uplinks { @@ -923,7 +920,6 @@ func TestClampDataRateRange(t *testing.T) { ExpectedMaxDataRateIndex: ttnpb.DataRateIndex_DATA_RATE_10, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1232,7 +1228,6 @@ func TestClampTxPowerRange(t *testing.T) { ExpectedMaxTxPowerIndex: 10, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1480,7 +1475,6 @@ func TestClampNbTrans(t *testing.T) { ExpectedNbTrans: 2, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1602,7 +1596,6 @@ func TestADRUplinks(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1777,7 +1770,6 @@ func TestADRDataRange(t *testing.T) { Band: &band.EU_863_870_RP1_V1_0_2_Rev_B, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1870,7 +1862,6 @@ func TestADRTxPowerRange(t *testing.T) { Band: &band.EU_863_870_RP1_V1_0_2_Rev_B, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -1999,7 +1990,6 @@ func TestADRMargin(t *testing.T) { Ok: true, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -2431,7 +2421,6 @@ func TestADRAdaptTxPowerIndex(t *testing.T) { OutputMargin: -14.5, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -2591,7 +2580,6 @@ func TestADRAdaptNbTrans(t *testing.T) { ExpectedDevice: newEndDevice(3, 3), }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -2650,7 +2638,6 @@ func TestDemodulationFloorStep(t *testing.T) { Step: 6.0, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -2702,7 +2689,6 @@ func TestIsNarrowDataRateIndex(t *testing.T) { Ok: false, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -2961,7 +2947,6 @@ func TestADRSteerDeviceChannels(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/networkserver/mac/beacon_freq_test.go b/pkg/networkserver/mac/beacon_freq_test.go index 6e8f8b0dd0..57ec74e1f7 100644 --- a/pkg/networkserver/mac/beacon_freq_test.go +++ b/pkg/networkserver/mac/beacon_freq_test.go @@ -84,7 +84,6 @@ func TestNeedsBeaconFreqReq(t *testing.T) { }) for _, tc := range tcs { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -227,7 +226,6 @@ func TestHandleBeaconFreqAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/beacon_timing_test.go b/pkg/networkserver/mac/beacon_timing_test.go index 7be5a3d33e..058d4cb702 100644 --- a/pkg/networkserver/mac/beacon_timing_test.go +++ b/pkg/networkserver/mac/beacon_timing_test.go @@ -55,7 +55,6 @@ func TestNeedsBeaconTimingReq(t *testing.T) { }) for _, tc := range tcs { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -118,7 +117,6 @@ func TestHandleBeaconTimingReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/dev_status_test.go b/pkg/networkserver/mac/dev_status_test.go index 70cbc296a6..b6a0113d91 100644 --- a/pkg/networkserver/mac/dev_status_test.go +++ b/pkg/networkserver/mac/dev_status_test.go @@ -166,7 +166,6 @@ func TestNeedsDevStatusReq(t *testing.T) { Needs: 1000-1 >= DefaultStatusCountPeriodicity, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -331,7 +330,6 @@ func TestHandleDevStatusAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/device_mode_test.go b/pkg/networkserver/mac/device_mode_test.go index bac46e848e..1b24174e86 100644 --- a/pkg/networkserver/mac/device_mode_test.go +++ b/pkg/networkserver/mac/device_mode_test.go @@ -146,7 +146,6 @@ func TestHandleDeviceModeInd(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/device_time_test.go b/pkg/networkserver/mac/device_time_test.go index 753ad4a7ea..dc2d3ab650 100644 --- a/pkg/networkserver/mac/device_time_test.go +++ b/pkg/networkserver/mac/device_time_test.go @@ -197,7 +197,6 @@ func TestHandleDeviceTimeReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/dl_channel_test.go b/pkg/networkserver/mac/dl_channel_test.go index 3cf5a97f74..b5b0e594e8 100644 --- a/pkg/networkserver/mac/dl_channel_test.go +++ b/pkg/networkserver/mac/dl_channel_test.go @@ -299,7 +299,6 @@ func TestDLChannelReq(t *testing.T) { RejectedFrequencies: []uint64{130}, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: func() string { formatChannels := func(chs ...*ttnpb.MACParameters_Channel) string { @@ -689,7 +688,6 @@ func TestHandleDLChannelAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/duty_cycle_test.go b/pkg/networkserver/mac/duty_cycle_test.go index 1a19d70fab..bfcee56840 100644 --- a/pkg/networkserver/mac/duty_cycle_test.go +++ b/pkg/networkserver/mac/duty_cycle_test.go @@ -64,7 +64,6 @@ func TestNeedsDutyCycleReq(t *testing.T) { Needs: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -135,7 +134,6 @@ func TestHandleDutyCycleAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/link_adr_test.go b/pkg/networkserver/mac/link_adr_test.go index cd30d6b0e8..d3cde96bb9 100644 --- a/pkg/networkserver/mac/link_adr_test.go +++ b/pkg/networkserver/mac/link_adr_test.go @@ -312,7 +312,6 @@ func TestLinkADRReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: fmt.Sprintf("%s/band:%s,MAC:%s,PHY:%s,DR:%d->%d,TX:%d->%d,NB:%d->%d,rejected_DR:%v,rejected_TX:%v", tc.Name, @@ -1053,7 +1052,6 @@ func TestHandleLinkADRAns(t *testing.T) { AdrEnabled: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/link_check_test.go b/pkg/networkserver/mac/link_check_test.go index 6fc58ea059..50784eca6b 100644 --- a/pkg/networkserver/mac/link_check_test.go +++ b/pkg/networkserver/mac/link_check_test.go @@ -326,7 +326,6 @@ func TestHandleLinkCheckReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/mac_test.go b/pkg/networkserver/mac/mac_test.go index 1018b137f6..7b9c3c7c06 100644 --- a/pkg/networkserver/mac/mac_test.go +++ b/pkg/networkserver/mac/mac_test.go @@ -390,7 +390,6 @@ func TestHandleMACResponseBlock(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/networkserver/mac/new_channel_test.go b/pkg/networkserver/mac/new_channel_test.go index f30ac5e72d..f73fd29668 100644 --- a/pkg/networkserver/mac/new_channel_test.go +++ b/pkg/networkserver/mac/new_channel_test.go @@ -278,7 +278,6 @@ func TestNewChannelReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: func() string { formatChannels := func(chs ...*ttnpb.MACParameters_Channel) string { @@ -575,7 +574,6 @@ func TestHandleNewChannelAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/ping_slot_channel_test.go b/pkg/networkserver/mac/ping_slot_channel_test.go index ae72e8d95c..02612bd2bb 100644 --- a/pkg/networkserver/mac/ping_slot_channel_test.go +++ b/pkg/networkserver/mac/ping_slot_channel_test.go @@ -84,7 +84,6 @@ func TestNeedsPingSlotChannelReq(t *testing.T) { Needs: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -232,7 +231,6 @@ func TestHandlePingSlotChannelAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/ping_slot_info_test.go b/pkg/networkserver/mac/ping_slot_info_test.go index 23b5745813..d9c007945d 100644 --- a/pkg/networkserver/mac/ping_slot_info_test.go +++ b/pkg/networkserver/mac/ping_slot_info_test.go @@ -130,7 +130,6 @@ func TestHandlePingSlotInfoReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/rejoin_param_setup_test.go b/pkg/networkserver/mac/rejoin_param_setup_test.go index bcc814a333..d44dfd0cce 100644 --- a/pkg/networkserver/mac/rejoin_param_setup_test.go +++ b/pkg/networkserver/mac/rejoin_param_setup_test.go @@ -99,7 +99,6 @@ func TestNeedsRejoinParamSetupReq(t *testing.T) { } for _, tc := range tcs { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -232,7 +231,6 @@ func TestHandleRejoinParamSetupAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/rekey_test.go b/pkg/networkserver/mac/rekey_test.go index 9fe3d1a584..6ecc7d8641 100644 --- a/pkg/networkserver/mac/rekey_test.go +++ b/pkg/networkserver/mac/rekey_test.go @@ -255,7 +255,6 @@ func TestHandleRekeyInd(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/relay_conf_test.go b/pkg/networkserver/mac/relay_conf_test.go index 898c32b134..37fc0ee301 100644 --- a/pkg/networkserver/mac/relay_conf_test.go +++ b/pkg/networkserver/mac/relay_conf_test.go @@ -144,7 +144,6 @@ func TestDeviceNeedsRelayConfReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -489,7 +488,6 @@ func TestEnqueueRelayConfReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -891,7 +889,6 @@ func TestHandleRelayConfAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/relay_configure_fwd_limit_test.go b/pkg/networkserver/mac/relay_configure_fwd_limit_test.go index ef541b4886..fee5b835a1 100644 --- a/pkg/networkserver/mac/relay_configure_fwd_limit_test.go +++ b/pkg/networkserver/mac/relay_configure_fwd_limit_test.go @@ -147,7 +147,6 @@ func TestDeviceNeedsRelayConfigureFwdLimitReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -328,7 +327,6 @@ func TestEnqueueRelayConfigureFwdLimitReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -499,7 +497,6 @@ func TestHandleRelayConfigureFwdLimitAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/relay_ctrl_uplink_list_test.go b/pkg/networkserver/mac/relay_ctrl_uplink_list_test.go index 135c33fd76..a13edebea9 100644 --- a/pkg/networkserver/mac/relay_ctrl_uplink_list_test.go +++ b/pkg/networkserver/mac/relay_ctrl_uplink_list_test.go @@ -161,7 +161,6 @@ func TestDeviceNeedsRelayCtrlUplinkListReq(t *testing.T) { Needs: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -302,7 +301,6 @@ func TestEnqueueRelayCtrlUplinkListReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -431,7 +429,6 @@ func TestHandleRelayCtrlUplinkListAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/relay_end_device_conf_test.go b/pkg/networkserver/mac/relay_end_device_conf_test.go index d9699ae5cd..5276c32012 100644 --- a/pkg/networkserver/mac/relay_end_device_conf_test.go +++ b/pkg/networkserver/mac/relay_end_device_conf_test.go @@ -123,7 +123,6 @@ func TestDeviceNeedsRelayEndDeviceConfReq(t *testing.T) { Needs: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -266,7 +265,6 @@ func TestEnqueueRelayEndDeviceConfReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -475,7 +473,6 @@ func TestHandleRelayEndDeviceConfAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/relay_update_uplink_list_test.go b/pkg/networkserver/mac/relay_update_uplink_list_test.go index 32a7bdb9bd..a97d50781d 100644 --- a/pkg/networkserver/mac/relay_update_uplink_list_test.go +++ b/pkg/networkserver/mac/relay_update_uplink_list_test.go @@ -176,7 +176,6 @@ func TestDeviceNeedsRelayUpdateUplinkListReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -424,7 +423,6 @@ func TestEnqueueRelayUpdateUplinkListReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -650,7 +648,6 @@ func TestHandleRelayUpdateUplinkListAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/reset_test.go b/pkg/networkserver/mac/reset_test.go index c045f95819..f4b37d00b7 100644 --- a/pkg/networkserver/mac/reset_test.go +++ b/pkg/networkserver/mac/reset_test.go @@ -158,7 +158,6 @@ func TestHandleResetInd(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/rx_param_setup_test.go b/pkg/networkserver/mac/rx_param_setup_test.go index c670e5cb18..30c1485285 100644 --- a/pkg/networkserver/mac/rx_param_setup_test.go +++ b/pkg/networkserver/mac/rx_param_setup_test.go @@ -128,7 +128,6 @@ func TestNeedsRxParamSetupReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -264,7 +263,6 @@ func TestHandleRxParamSetupAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/rx_timing_setup_test.go b/pkg/networkserver/mac/rx_timing_setup_test.go index 2d5e034328..3e26f9b417 100644 --- a/pkg/networkserver/mac/rx_timing_setup_test.go +++ b/pkg/networkserver/mac/rx_timing_setup_test.go @@ -80,7 +80,6 @@ func TestNeedsRxTimingSetupReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -151,7 +150,6 @@ func TestHandleRxTimingSetupAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/tx_param_setup_test.go b/pkg/networkserver/mac/tx_param_setup_test.go index 6527117b1d..01d47e0011 100644 --- a/pkg/networkserver/mac/tx_param_setup_test.go +++ b/pkg/networkserver/mac/tx_param_setup_test.go @@ -160,7 +160,6 @@ func TestNeedsTxParamSetupReq(t *testing.T) { } for _, tc := range tcs { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -337,7 +336,6 @@ func TestEnqueueTxParamSetupReq(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -411,7 +409,6 @@ func TestHandleTxParamSetupAns(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/mac/utils_internal_test.go b/pkg/networkserver/mac/utils_internal_test.go index ac97da6838..84cc9a19d3 100644 --- a/pkg/networkserver/mac/utils_internal_test.go +++ b/pkg/networkserver/mac/utils_internal_test.go @@ -96,7 +96,6 @@ func TestDeviceDefaultChannels(t *testing.T) { Channels: au915928Post102BChannels, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -181,7 +180,6 @@ func TestDeviceDesiredChannels(t *testing.T) { Channels: au915928Post102BChannels, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -647,7 +645,6 @@ func TestNewState(t *testing.T) { FrequencyPlanStore: frequencyplans.NewStore(test.FrequencyPlansFetcher), }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, @@ -1055,7 +1052,6 @@ func TestBeaconTimeBefore(t *testing.T) { Expected: 10 * BeaconPeriod, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Time.String(), Parallel: true, @@ -1230,7 +1226,6 @@ func TestNextPingSlotAt(t *testing.T) { ExpectedOk: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/networkserver.go b/pkg/networkserver/networkserver.go index 48ace35235..f5e5c8245c 100644 --- a/pkg/networkserver/networkserver.go +++ b/pkg/networkserver/networkserver.go @@ -368,7 +368,6 @@ func New(c *component.Component, conf *Config, opts ...Option) (*NetworkServer, downlinkDispatchTaskName: ns.downlinkTasks, pendingDownlinkProcessTaskName: ns.pendingDownlinkTasks, } { - dispatcher := dispatcher ns.RegisterTask(&task.Config{ Context: ctx, ID: id, diff --git a/pkg/networkserver/networkserver_flow_test.go b/pkg/networkserver/networkserver_flow_test.go index 24b1f5be36..cd9cc6de23 100644 --- a/pkg/networkserver/networkserver_flow_test.go +++ b/pkg/networkserver/networkserver_flow_test.go @@ -95,7 +95,6 @@ func frequencyPlanMACCommands(macVersion ttnpb.MACVersion, phyVersion ttnpb.PHYV } var evBuilders []events.Builder for _, req := range linkADRReqs { - req := req evBuilders = append(evBuilders, mac.EvtEnqueueLinkADRRequest.With(events.WithData(req))) } return linkADRReqs, evBuilders, false @@ -439,7 +438,6 @@ func TestFlow(t *testing.T) { MakeTestCaseName("Class A", "OTAA"): makeClassAOTAAFlowTest(macVersion, phyVersion, fpID), MakeTestCaseName("Class C", "OTAA"): makeClassCOTAAFlowTest(macVersion, phyVersion, fpID), } { - handleFlowTest := handleFlowTest test.RunSubtest(t, test.SubtestConfig{ Name: makeName(flowName), Parallel: true, diff --git a/pkg/networkserver/networkserver_internal_test.go b/pkg/networkserver/networkserver_internal_test.go index 80d5d38415..18e09e82c8 100644 --- a/pkg/networkserver/networkserver_internal_test.go +++ b/pkg/networkserver/networkserver_internal_test.go @@ -224,7 +224,6 @@ func TestMakeNewDevAddrFunc(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a, ctx := test.New(t) diff --git a/pkg/networkserver/networkserver_util_internal_test.go b/pkg/networkserver/networkserver_util_internal_test.go index 5eefed27b3..0af7d96eb1 100644 --- a/pkg/networkserver/networkserver_util_internal_test.go +++ b/pkg/networkserver/networkserver_util_internal_test.go @@ -1392,7 +1392,6 @@ func (env TestEnvironment) AssertHandleDeviceUplink(ctx context.Context, assert close(errCh) }() for _, up := range ups[1:] { - up := up time.AfterFunc(env.Config.DeduplicationWindow/2, func() { t.Logf("Call GsNs.HandleUplink with duplicate uplink: %v", up) _, err := ttnpb.NewGsNsClient(env.ClientConn).HandleUplink(ctx, up) @@ -1492,7 +1491,6 @@ func (env TestEnvironment) AssertHandleJoinRequest(ctx context.Context, conf Joi ups := []*ttnpb.UplinkMessage{MakeJoinRequest(conf)} for _, mds := range duplicateMDs { - mds := mds duplicateConf := conf duplicateConf.RxMetadata = mds ups = append(ups, MakeJoinRequest(duplicateConf)) @@ -1884,7 +1882,6 @@ func (env TestEnvironment) AssertHandleDataUplink(ctx context.Context, conf Data deduplicatedUpConf.Matched = true ups := []*ttnpb.UplinkMessage{MakeDataUplink(upConf)} for _, mds := range conf.RxMetadatas[1:] { - mds := mds duplicateConf := upConf duplicateConf.RxMetadata = mds ups = append(ups, MakeDataUplink(duplicateConf)) diff --git a/pkg/networkserver/redis/registry_internal_test.go b/pkg/networkserver/redis/registry_internal_test.go index 3a3f1b6cf9..10c41da8ee 100644 --- a/pkg/networkserver/redis/registry_internal_test.go +++ b/pkg/networkserver/redis/registry_internal_test.go @@ -193,7 +193,6 @@ func TestMsgpackCompatibility(t *testing.T) { ), }, } { - tc := tc test.RunSubtestFromContext(ctx, test.SubtestConfig{ Name: fmt.Sprintf("%T/%s", tc.Value, tc.LuaExpr), Func: func(ctx context.Context, _ *testing.T, a *assertions.Assertion) { diff --git a/pkg/networkserver/relay_test.go b/pkg/networkserver/relay_test.go index cda20e0769..a1f8681772 100644 --- a/pkg/networkserver/relay_test.go +++ b/pkg/networkserver/relay_test.go @@ -246,7 +246,6 @@ func TestBatchDeriveRootWorSKey(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/networkserver/utils_internal_test.go b/pkg/networkserver/utils_internal_test.go index 96d7f2207e..396da2995e 100644 --- a/pkg/networkserver/utils_internal_test.go +++ b/pkg/networkserver/utils_internal_test.go @@ -552,7 +552,6 @@ func TestNextDataDownlinkSlot(t *testing.T) { ExpectedOk: true, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.Name, Parallel: true, diff --git a/pkg/packetbroker/token_test.go b/pkg/packetbroker/token_test.go index 659871e100..241c276169 100644 --- a/pkg/packetbroker/token_test.go +++ b/pkg/packetbroker/token_test.go @@ -175,7 +175,6 @@ func TestToken(t *testing.T) { }, }, } { - tc := tc test.RunSubtest(t, test.SubtestConfig{ Name: tc.name, Parallel: true, diff --git a/pkg/packetbrokeragent/agent_test.go b/pkg/packetbrokeragent/agent_test.go index 157b437652..b3a77181b5 100644 --- a/pkg/packetbrokeragent/agent_test.go +++ b/pkg/packetbrokeragent/agent_test.go @@ -597,7 +597,6 @@ func TestForwarder(t *testing.T) { }, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { // nolint:paralleltest // If validateUpdate or setRequestContacts are not set, the tests will panic. if tc.validateResponse == nil { diff --git a/pkg/pfconfig/lbslns/lbslbs_test.go b/pkg/pfconfig/lbslns/lbslbs_test.go index c14459e506..e08d9b2377 100644 --- a/pkg/pfconfig/lbslns/lbslbs_test.go +++ b/pkg/pfconfig/lbslns/lbslbs_test.go @@ -266,7 +266,6 @@ func TestGetRouterConfig(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -465,7 +464,6 @@ func TestGetRouterConfigWithMultipleFP(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() @@ -537,7 +535,6 @@ func TestGetDataRatesFromFrequencyPlan(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/pfconfig/semtechudp/semtechudp_test.go b/pkg/pfconfig/semtechudp/semtechudp_test.go index 97ce438f9c..2726eecdc4 100644 --- a/pkg/pfconfig/semtechudp/semtechudp_test.go +++ b/pkg/pfconfig/semtechudp/semtechudp_test.go @@ -145,7 +145,6 @@ func TestConfigSerialization(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/qrcodegenerator/grpc_gateways_test.go b/pkg/qrcodegenerator/grpc_gateways_test.go index 0c6971fdad..1b6029c858 100644 --- a/pkg/qrcodegenerator/grpc_gateways_test.go +++ b/pkg/qrcodegenerator/grpc_gateways_test.go @@ -124,7 +124,6 @@ func TestGatewayQRCodeParsing(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/qrcodegenerator/qrcode/gateways/gateways_test.go b/pkg/qrcodegenerator/qrcode/gateways/gateways_test.go index 17d1439b4e..c4792ff226 100644 --- a/pkg/qrcodegenerator/qrcode/gateways/gateways_test.go +++ b/pkg/qrcodegenerator/qrcode/gateways/gateways_test.go @@ -41,8 +41,6 @@ func TestParseGatewaysAuthenticationCodes(t *testing.T) { ExpectedOwnerToken: "abcdef123456", }, } { - tc := tc - t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/qrcodegenerator/qrcode/gateways/ttigpro1_test.go b/pkg/qrcodegenerator/qrcode/gateways/ttigpro1_test.go index e4ccabe59a..e29c0af4f9 100644 --- a/pkg/qrcodegenerator/qrcode/gateways/ttigpro1_test.go +++ b/pkg/qrcodegenerator/qrcode/gateways/ttigpro1_test.go @@ -92,7 +92,6 @@ func TestTTIGPRO1(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() diff --git a/pkg/rpcmiddleware/discover/discover_test.go b/pkg/rpcmiddleware/discover/discover_test.go index 1b579b6f8e..d6e529c9ae 100644 --- a/pkg/rpcmiddleware/discover/discover_test.go +++ b/pkg/rpcmiddleware/discover/discover_test.go @@ -169,7 +169,6 @@ func TestResolver(t *testing.T) { }, }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() dns := &mockResolver{ @@ -269,7 +268,6 @@ func TestDefaultPort(t *testing.T) { "[::]": "", // Invalid address "[::": "", // Invalid address } { - input, expected := input, expected t.Run(input, func(t *testing.T) { t.Parallel() target, err := discover.DefaultPort(input, 8884) @@ -326,7 +324,6 @@ func TestDefaultURL(t *testing.T) { expected: "https://hostname:8443", }, } { - tc := tc t.Run(tc.expected, func(t *testing.T) { t.Parallel() target, err := discover.DefaultURL(tc.target, tc.port, tc.tls) diff --git a/pkg/ttnpb/fieldmask_utils_test.go b/pkg/ttnpb/fieldmask_utils_test.go index bd61538fdf..1b5408c1c6 100644 --- a/pkg/ttnpb/fieldmask_utils_test.go +++ b/pkg/ttnpb/fieldmask_utils_test.go @@ -282,7 +282,6 @@ func TestFieldMaskPathsSet(t *testing.T) { }, } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() actual := FieldMaskPathsSet(tc.Paths) @@ -398,7 +397,6 @@ func TestFieldMaskPathsSetContainsAll(t *testing.T) { }, } for _, tc := range testCases { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() actualContainsAll, actualMissing := FieldMaskPathsSetContainsAll(tc.Set, tc.Subset...) diff --git a/pkg/webmiddleware/redirect_test.go b/pkg/webmiddleware/redirect_test.go index 60e14f2b11..3cf83fc154 100644 --- a/pkg/webmiddleware/redirect_test.go +++ b/pkg/webmiddleware/redirect_test.go @@ -89,7 +89,6 @@ func TestRedirect(t *testing.T) { Redirect: "https://dev.example.com/path", }, } { - tc := tc t.Run(tc.Name, func(t *testing.T) { t.Parallel() a := assertions.New(t) diff --git a/pkg/webui/csp_test.go b/pkg/webui/csp_test.go index b3bedb6efe..b4746e83a8 100644 --- a/pkg/webui/csp_test.go +++ b/pkg/webui/csp_test.go @@ -47,7 +47,6 @@ func TestRewriteScheme(t *testing.T) { expected: []string{"https://example.com", "wss://example.com"}, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() a := assertions.New(t) @@ -84,7 +83,6 @@ func TestRewriteSchemes(t *testing.T) { }, }, } { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() a := assertions.New(t)