takeFirst will take the first non-empty value.
(values ...Value)
| 894 | |
| 895 | // takeFirst will take the first non-empty value. |
| 896 | func takeFirst[Value comparable](values ...Value) Value { |
| 897 | var empty Value |
| 898 | return takeFirstF(values, func(v Value) bool { |
| 899 | return v != empty |
| 900 | }) |
| 901 | } |
| 902 | |
| 903 | // takeFirstTime returns the first non-zero time.Time. |
| 904 | func takeFirstTime(values ...time.Time) time.Time { |
no test coverage detected