Package ptr
provides convert functions between value and pointer with using
generics.
Import github.com/koron-go/ptr
.
Get a pointer of a value.
ptr.P(123) // (*int)
ptr.P("foo") // (*string)
Get a value which referenced by a pointer.
n := 123
ptr.V(&n) // 123 (int)
s := "abc"
ptr.V(&s) // "abc" (string)