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

Replace reflect.SliceHeader with unsafe.Slice #21

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

shane-ns1
Copy link

Fixes part of #20

This PR fixes the go vet warning caused by the use of reflect.SliceHeader() by replacing it with unsafe.Slice().


I'm not 100% this actually works as desired, as the unsafe and reflect libraries both feel like voodoo to me. There don't seem to be tests in this area, but maybe I missed them?


This requires a version bump for Go:

./main.go:246:14: unsafe.Slice requires go1.17 or later (-lang was set to go1.15; check go.mod)

This is probably reasonable, since Go supports two major releases at a time:
https://go.dev/doc/devel/release#policy

And we're on Go 1.21, meaning that anything older than Go 1.19 is unsupported.

OTOH, I can see how dropping support for language release from less than 3 years ago could seem a bit aggressive. ¯\_(ツ)_/¯

@wojas
Copy link
Member

wojas commented Oct 31, 2023

I agree that the bump is reasonable. We loosely follow the Go support policy, as following those minor releases is a good idea and generally safe. We currently only test in CI with 1.19+. Older versions of Go may or may not work.

@wojas wojas merged commit 1510b01 into PowerDNS:master Oct 31, 2023
4 checks passed
@wojas wojas added this to the v1.9.2 milestone Dec 7, 2023
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