Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 09:54:24 +01:00

Revert "cherry pick only IfZero from (#29755)"

This reverts commit 82851f429a.
This commit is contained in:
Shiny Nematoda 2024-03-28 11:46:41 +00:00
parent 1684f0e5bf
commit a38260aed9

View file

@ -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
}