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(goversion): upgrade minimum version to 1.22 #1145

Merged
merged 1 commit into from
Sep 5, 2024
Merged

chore(goversion): upgrade minimum version to 1.22 #1145

merged 1 commit into from
Sep 5, 2024

Conversation

M4tteoP
Copy link
Member

@M4tteoP M4tteoP commented Sep 5, 2024

Go 1.23 is out, so as per our policy, we should be fine supporting go 1.22 and go 1.23:
Note: It should also unblock #1089, which requires go >= 1.22

@@ -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
Copy link
Member Author

@M4tteoP M4tteoP Sep 5, 2024

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)))

Copy link
Member

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...

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filled #1147.

Copy link
Member

@fzipi fzipi left a 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.

@M4tteoP M4tteoP marked this pull request as ready for review September 5, 2024 21:13
@M4tteoP M4tteoP requested a review from a team as a code owner September 5, 2024 21:13
Copy link
Member

@fzipi fzipi left a 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.

@fzipi fzipi merged commit be8c6af into main Sep 5, 2024
6 checks passed
@fzipi fzipi deleted the go1.23 branch September 5, 2024 22:52
durg78 added a commit to durg78/coraza that referenced this pull request Sep 6, 2024
chore(goversion): upgrade minimum version to 1.22 (corazawaf#1145)
@durg78 durg78 mentioned this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants