Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tools): Bump golangci-lint from v1.53.2 to v1.54.2 #13838

Merged
merged 9 commits into from
Aug 29, 2023

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Aug 29, 2023

We need to bump the linter in order to be compatible with go 1.21 (see nightly build error for Windows). This PR bumps the linter and fixes the newly found issues.

@telegraf-tiger
Copy link
Contributor

@zak-pawel
Copy link
Collaborator

@srebhan
About G601 findings you have fixed in this PR:

plugins/inputs/aliyuncms/aliyuncms.go:159:53               gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/aliyuncms/aliyuncms.go:162:54               gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/couchbase/couchbase.go:110:53               gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/logstash/logstash.go:459:35                 gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/vsphere/endpoint.go:654:41                  gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/vsphere/endpoint.go:700:42                  gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/vsphere/endpoint.go:724:41                  gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/vsphere/endpoint.go:753:41                  gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/vsphere/endpoint.go:859:41                  gosec  G601: Implicit memory aliasing in for loop.
plugins/inputs/vsphere/endpoint.go:888:41                  gosec  G601: Implicit memory aliasing in for loop.
plugins/outputs/cloudwatch_logs/cloudwatch_logs.go:378:34  gosec  G601: Implicit memory aliasing in for loop.
plugins/outputs/iotdb/iotdb_test.go:268:27                 gosec  G601: Implicit memory aliasing in for loop.
plugins/outputs/iotdb/iotdb_test.go:348:55                 gosec  G601: Implicit memory aliasing in for loop.
plugins/outputs/iotdb/iotdb_test.go:482:28                 gosec  G601: Implicit memory aliasing in for loop.
plugins/outputs/iotdb/iotdb_test.go:484:31                 gosec  G601: Implicit memory aliasing in for loop.

I believe that most of them are false-positives.

This PR introduced code which found these issues: securego/gosec#966 and fix was made here securego/gosec#1003

I believe that mentioned fix hasn't been yet released (it is not contained in latest v2.17.0.

@srebhan
Copy link
Member Author

srebhan commented Aug 29, 2023

@zak-pawel I'm not so sure about those being false positives. Most of them take the address of an iterator and pass it on to other functions. While this works in those cases it is fragile because as soon as you store that pointer in any of the sub-routines you get into trouble. As we do not modify the value in the pointer in almost all cases I pass the data (mostly strings) by value rather than passing the pointer...

@zak-pawel
Copy link
Collaborator

@zak-pawel I'm not so sure about those being false positives. Most of them take the address of an iterator and pass it on to other functions. While this works in those cases it is fragile because as soon as you store that pointer in any of the sub-routines you get into trouble. As we do not modify the value in the pointer in almost all cases I pass the data (mostly strings) by value rather than passing the pointer...

I can agree with your explanation :)

@powersj powersj merged commit 1d24efe into influxdata:master Aug 29, 2023
4 checks passed
@github-actions github-actions bot added this to the v1.28.0 milestone Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants