-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
etcd: modify declaring empty slices #14479
Conversation
declare an empty slice to var s []int replace s :=[]int{}, https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices Signed-off-by: demoManito <1430482733@qq.com>
1c666e1
to
72cf0cc
Compare
Please fix the test failures. |
Please consider introducing a static analysis that will prevent future regressions. I expect something already exists in golangci, just needs to be enabled in https://github.com/etcd-io/etcd/blob/main/.golangci.yaml |
Yes, let's do this in a separate PR. @demoManito Please fix the test failures. |
@ahrtr test success |
I couldn't find any linter for this task in https://golangci-lint.run/usage/linters/ |
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.
The change looks safe to me, so merging it |
Thanks @cenkalti for the feedback. |
declare an empty slice to
var s []int
replaces :=[]int{}
, https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices