diff --git a/.golangci.yaml b/.golangci.yaml index b551958f..41d5a57b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -65,7 +65,7 @@ linters: # - paralleltest # - perfsprint # - prealloc -# - predeclared + - predeclared - promlinter # - protogetter - reassign diff --git a/detector/detector_test.go b/detector/detector_test.go index 10e427c9..8de2bff0 100644 --- a/detector/detector_test.go +++ b/detector/detector_test.go @@ -169,7 +169,7 @@ func TestRun(t *testing.T) { } func withDetectorName(f *detector.Finding, det string) *detector.Finding { - copy := *f - copy.Detectors = []string{det} - return © + c := *f + c.Detectors = []string{det} + return &c } diff --git a/scalibr_test.go b/scalibr_test.go index 99505bd8..161f882b 100644 --- a/scalibr_test.go +++ b/scalibr_test.go @@ -185,9 +185,9 @@ func TestScan(t *testing.T) { } func withDetectorName(f *detector.Finding, det string) *detector.Finding { - copy := *f - copy.Detectors = []string{det} - return © + c := *f + c.Detectors = []string{det} + return &c } func TestEnableRequiredExtractors(t *testing.T) { diff --git a/testing/fakedetector/fake_detector.go b/testing/fakedetector/fake_detector.go index 635b0bb1..8df02032 100644 --- a/testing/fakedetector/fake_detector.go +++ b/testing/fakedetector/fake_detector.go @@ -38,15 +38,15 @@ type fakeDetector struct { // // The detector returns the specified Finding or error. func New(name string, version int, finding *detector.Finding, err error) detector.Detector { - var copy *detector.Finding + var c *detector.Finding if finding != nil { - copy = &detector.Finding{} - *copy = *finding + c = &detector.Finding{} + *c = *finding } return &fakeDetector{ DetName: name, DetVersion: version, - Finding: copy, + Finding: c, Err: err, } }