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

Add Ptr func #345

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Add Ptr func #345

merged 1 commit into from
Jun 29, 2022

Conversation

plorenz
Copy link
Member

@plorenz plorenz commented Jun 29, 2022

No description provided.

@plorenz plorenz requested a review from a team as a code owner June 29, 2022 18:27
package util

// Ptr returns a pointer to the given value. Allows succinctly creating pointers to constants
func Ptr[T any](val T) *T {
Copy link
Member

Choose a reason for hiding this comment

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

I have similar pre-generics functions just for this dealing w/ strings/dates/etc. Will be nice to remove them.

@plorenz plorenz merged commit 38c8d29 into main Jun 29, 2022
@plorenz plorenz deleted the add-ptr-func branch June 29, 2022 18:54
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.

None yet

2 participants