Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't lint the generated deepcopy file
I found it a bit hard to understand how to configure this but looking at the example config (https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml) this seems right. Since we don't control these files, it makes sense to skip linting them. Recently we bumped the linter, which pulled in a new version of gosec, which started flagging "Implicit memory aliasing in for loop" in the generated files. This is a bit weird but at least we know that the values are being used immediately and not stored, so it seems (famous last words) unlikely to hit the bug these are trying to catch (this issue has an example of the kind of bug this catches: https://github.com/trailofbits/gosec/issues/1) e.g. the code getting flagged: ``` for key, val := range *in { var outVal *PipelineRunTaskRunStatus if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = new(PipelineRunTaskRunStatus) (*in).DeepCopyInto(*out) } (*out)[key] = outVal } ```
- Loading branch information