Skip to content

Commit

Permalink
Merge pull request #299 from ackama:linting/enable-predeclared
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 698317433
  • Loading branch information
copybara-github committed Nov 20, 2024
2 parents 178fdef + e0768be commit 7ef3529
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ linters:
# - paralleltest
# - perfsprint
# - prealloc
# - predeclared
- predeclared
- promlinter
# - protogetter
- reassign
Expand Down
6 changes: 3 additions & 3 deletions detector/detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 &copy
c := *f
c.Detectors = []string{det}
return &c
}
6 changes: 3 additions & 3 deletions scalibr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 &copy
c := *f
c.Detectors = []string{det}
return &c
}

func TestEnableRequiredExtractors(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions testing/fakedetector/fake_detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down

0 comments on commit 7ef3529

Please sign in to comment.