Skip to content

Commit

Permalink
add to.Ptr and to.Val
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke committed Feb 24, 2024
1 parent 271a75e commit 39041cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utils/to/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ func Value[N PointerInterface](val *N) N {
func ValuePtr[N PointerInterface](val N) *N {
return &val
}

// Val return the value from a pointer
func Val[N PointerInterface](val N) *N {
return &val
}

// Ptr return the pointer from value
func Ptr[N PointerInterface](val N) *N {
return &val
}

0 comments on commit 39041cd

Please sign in to comment.