Skip to content

Commit

Permalink
chore: document PtrOrEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap authored and ezr-ondrej committed Jan 16, 2024
1 parent e4a650b commit ef028dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/ptr/any.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func From[T any](ref *T) (value T) {
return
}

// FromOrEmpty returns the value or empty value in case the value is nil.
func FromOrEmpty[T any](ref *T) (value T) {
if ref != nil {
value = *ref
Expand Down

0 comments on commit ef028dc

Please sign in to comment.