Skip to content

Commit c43746e

Browse files
committed
builtin: deprecate FirstNonEmpty() in favor of stdlib's cmp.Or()
1 parent dbe1ad0 commit c43746e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

builtin/builtin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func ErrorIfUnset(isUnset bool, fieldName string) error {
5555
}
5656

5757
// returns the first non-empty value.
58+
// Deprecated: use `cmp.Or()`
5859
func FirstNonEmpty[T comparable](values ...T) T {
5960
var empty T
6061
for _, value := range values {

0 commit comments

Comments
 (0)