Revert "cherry pick only IfZero
from (#29755)"
This reverts commit 82851f429a
.
This commit is contained in:
parent
1684f0e5bf
commit
a38260aed9
1 changed files with 0 additions and 9 deletions
|
@ -212,12 +212,3 @@ func ToFloat64(number any) (float64, error) {
|
|||
func ToPointer[T any](val T) *T {
|
||||
return &val
|
||||
}
|
||||
|
||||
// IfZero returns "def" if "v" is a zero value, otherwise "v"
|
||||
func IfZero[T comparable](v, def T) T {
|
||||
var zero T
|
||||
if v == zero {
|
||||
return def
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue