-
-
Notifications
You must be signed in to change notification settings - Fork 212
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(goversion): upgrade minimum version to 1.22 #1145
Conversation
@@ -399,7 +399,7 @@ func (r *Rule) transformArg(arg types.MatchData, argIdx int, cache map[transform | |||
default: | |||
// NOTE: See comment on transformationKey struct to understand this hacky code | |||
argKey := arg.Key() | |||
argKeyPtr := (*reflect.StringHeader)(unsafe.Pointer(&argKey)).Data | |||
argKeyPtr := (*reflect.StringHeader)(unsafe.Pointer(&argKey)).Data // nolint:staticcheck |
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.
reflect.StringHeader
has been deprecated and the linter is complaining.
Something like the following might do the trick, but I don't want to rush changes on something very hack and performance-related.
argKeyPtr := uintptr(unsafe.Pointer(unsafe.StringData(argKey)))
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.
Ugh, why do we need unsafe in the first place...
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.
This is the historical context: #553. We should revisit and see if we have some other viable option. If this looks okay, we can go ahead with merging and I'll open an issue about that
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.
Yes, let's upgrade the golang part and create a follow up issue.
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.
Filled #1147.
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 see this as a good change.
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'll try to get this done using renovate next time.
chore(goversion): upgrade minimum version to 1.22 (corazawaf#1145)
Go 1.23
is out, so as per our policy, we should be fine supportinggo 1.22
andgo 1.23
:Note: It should also unblock #1089, which requires go >= 1.22