-
Notifications
You must be signed in to change notification settings - Fork 833
Modernize the entire codebase #7005
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
Modernize the entire codebase #7005
Conversation
49d999b
to
be4d8dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. This looks promising.
Do you think we can add the tool to our CI? So we don't have to manually run it next time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
be4d8dc
to
1178d98
Compare
Signed-off-by: SungJin1212 <[email protected]>
Signed-off-by: SungJin1212 <[email protected]>
35469ad
to
86be435
Compare
Signed-off-by: SungJin1212 <[email protected]>
@yeya24 |
Signed-off-by: Friedrich Gonzalez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is all probably ok. I did review all 298 files.
I left some comments.
See if you can spot all b.ResetTImers. I bet they all can be removed too as a result of this.
Thanks for doing this!
Signed-off-by: SungJin1212 <[email protected]>
Signed-off-by: SungJin1212 <[email protected]>
Signed-off-by: SungJin1212 <[email protected]>
@friedrichg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it
for id, instance := range ringDesc.Ingesters { | ||
ringDesc.Ingesters[id] = instance | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
This PR modernizes the entire code base by using https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize.
Inspired by this PR: prometheus/prometheus#17092
Most of the changes are:
interface{}
->any
range
in the for loopmin
/max
b.Loop()
in benchmarkslices.Contains
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]