-
Notifications
You must be signed in to change notification settings - Fork 117
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
don't call SizeOf for type parameters #1237
Conversation
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.
SGTM
@cristaloleg I use go1.18 locally, so I didn't mention that go-critic still uses 1.17. Do you have any plan\issue to upgrade go-critic to 1.18? I can try in separate pull request |
Well, that's a hard question to be honest. We should bump go-critic to Go 1.18 somewhere in July. CC: @quasilyte |
The code looks good now. |
StdSizes.SizeOf method doesn't support type parameters. https://github.com/golang/go/blob/78b722d8c2f764c3048c6f0344e9ebcd2687813d/src/go/types/sizes.go#L156-L159 sdsdFixes go-critic#1223
@cristaloleg rebased with master |
@cristaloleg Hi, can you take a look? |
Extended the dsl documentation to reflect the change: For expressions of unknown size, like type params in generics, any filter using this operand will fail. We're not using 0 as a fallback size to avoid the confusion with zero-sized values like `struct{}`. See go-critic/go-critic#1237 Fixes #406
Extended the dsl documentation to reflect the change: For expressions of unknown size, like type params in generics, any filter using this operand will fail. We're not using 0 as a fallback size to avoid the confusion with zero-sized values like `struct{}`. See go-critic/go-critic#1237 Fixes #406
StdSizes.SizeOf method doesn't support type parameters. https://github.com/golang/go/blob/78b722d8c2f764c3048c6f0344e9ebcd2687813d/src/go/types/sizes.go#L156-L159
Fixes #1223