From a38260aed9df55e3615a1c7388c69696919943fe Mon Sep 17 00:00:00 2001 From: Shiny Nematoda Date: Thu, 28 Mar 2024 11:46:41 +0000 Subject: [PATCH] Revert "cherry pick only `IfZero` from (#29755)" This reverts commit 82851f429a590e8a33025ac030413f0b84e8404c. --- modules/util/util.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/modules/util/util.go b/modules/util/util.go index c94fb9104..5c7515819 100644 --- a/modules/util/util.go +++ b/modules/util/util.go @@ -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 -}