Skip to content

Commit

Permalink
feat: add value helper
Browse files Browse the repository at this point in the history
  • Loading branch information
katallaxie authored Jul 30, 2024
1 parent 12fccc2 commit cf3447e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cast/ptr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ package cast
func Ptr[T any](val T) *T {
return &val
}

// Value returns the value of the pointer.
func Value[T any](val *T) T {
return *val
}

0 comments on commit cf3447e

Please sign in to comment.