Skip to content

Conversation

Dentrax
Copy link

@Dentrax Dentrax commented Nov 1, 2022

Signed-off-by: Furkan [email protected]

I tried to use pointer package first time, but unfortunately it couldn't cover my needs for the generics in the first place. So, this PR introduces 2 new functions for generics:

  • Deref(): Like Get() but slightly different. It returns any. Which we can nil-check.
  • GetValue(): Like the functions in value.go, but using generics to deref under the hood. Only supports primitive types.
  • Also updates go.mod to 1.19.

Thanks to @peterhellberg for being helpful on Go Slack! Find his demo: https://go.dev/play/p/bAwvt92thoS

/cc @AlekSi

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.

1 participant