This repository was archived by the owner on Nov 25, 2025. It is now read-only.
chore: align PointerTo functions#1347
Open
JonathanOppenheimer wants to merge 10 commits intomasterfrom
Open
Conversation
|
|
||
| func NewUint64(val uint64) *uint64 { return &val } | ||
| // PointerTo returns a pointer to the given value. | ||
| func PointerTo[T any](x T) *T { return &x } |
Contributor
Author
There was a problem hiding this comment.
The function should be moved here, rather than utilstest as it not only used in tests.
PointerTo functions
alarso16
reviewed
Oct 17, 2025
Contributor
alarso16
left a comment
There was a problem hiding this comment.
I'm not sure I love this change. I liked NewUint64, since most of the time that you use the new function, you're casting to uint64 inside as well. It does look correct though
Contributor
Author
This is Stephen/Cey's suggestion to do -- it does get use beyond |
Contributor
Author
|
I guess maybe one benefit of doing it this way, is the linter now catches needless typing errors. |
Signed-off-by: Jonathan Oppenheimer <jonathan.oppenheimer@avalabs.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this should be merged
There were a number of various pointer functions dispersed throughout the codebase. This PR aligns them all to a single implementation.
This PR closes ava-labs/avalanchego#4567.