Skip to content

Commit

Permalink
Disable unparam linting on test files
Browse files Browse the repository at this point in the history
Parameters getting the same value in all (current) uses isn't
significant.

Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt committed Feb 13, 2024
1 parent 9752fb3 commit 4e73a90
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,5 @@ issues:
linters:
- gochecknoinits
- goerr113
- unparam
- wrapcheck
2 changes: 0 additions & 2 deletions coredns/plugin/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ func (t *handlerTestDriver) executeTestCase(rec *dnstest.Recorder, tc test.Case)
}
}

//nolint:unparam // `name` always receives `service1'.
func newServiceImport(namespace, name string, siType mcsv1a1.ServiceImportType) *mcsv1a1.ServiceImport {
return &mcsv1a1.ServiceImport{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -1005,7 +1004,6 @@ func newServiceImport(namespace, name string, siType mcsv1a1.ServiceImportType)
}
}

//nolint:unparam // `namespace` always receives `namespace1`.
func newEndpointSlice(namespace, name, clusterID string, ports []mcsv1a1.ServicePort, endpoints ...discovery.Endpoint,
) *discovery.EndpointSlice {
epPorts := make([]discovery.EndpointPort, len(ports))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/discovery/headless_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func RunHeadlessDiscoveryClusterNameTest(f *lhframework.Framework) {
clusterBName, false, true, true)
}

//nolint:gocognit,unparam // This really isn't that complex and would be awkward to refactor.
//nolint:gocognit // This really isn't that complex and would be awkward to refactor.
func verifyHeadlessSRVRecordsWithDig(f *framework.Framework, cluster framework.ClusterIndex, service *corev1.Service,
targetPod *corev1.PodList, hostNameList, domains []string, clusterName string, withPort, withcluster, shouldContain bool,
) {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/discovery/service_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ func RunServicesClusterAvailabilityMultiClusterTest(f *lhframework.Framework) {
checkedDomains, "", false)
}

//nolint:unparam // Keep srcCluster as a parameter for consistency and possible future extensions
func verifySRVWithDig(f *framework.Framework, srcCluster framework.ClusterIndex, service *corev1.Service, targetPod *corev1.PodList,
domains []string, clusterName string, withPort, shouldContain bool,
) {
Expand Down
1 change: 0 additions & 1 deletion test/e2e/discovery/statefulsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func RunSSPodsAvailabilityTest(f *lhframework.Framework) {
f.AwaitAggregatedServiceImport(framework.ClusterA, nginxServiceClusterB, 0)
}

//nolint:unparam // `targetCluster` always receives `framework.ClusterA`.
func verifyEndpointSlices(f *lhframework.Framework, targetCluster framework.ClusterIndex, netshootPodList *corev1.PodList,
endpointSlices *discovery.EndpointSliceList, service *corev1.Service, verifyCount int, shouldContain bool, localClusterName string,
) {
Expand Down

0 comments on commit 4e73a90

Please sign in to comment.