From 3f349b1b582b9d60a87a6cd05a84a6c7ad50bef5 Mon Sep 17 00:00:00 2001 From: Deluan Date: Thu, 21 Dec 2023 19:17:33 -0500 Subject: [PATCH] Add todo as a reminder to replace min/max in Go 1.22 --- utils/number/number.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/number/number.go b/utils/number/number.go index cc8aa7112..1ae4b9c59 100644 --- a/utils/number/number.go +++ b/utils/number/number.go @@ -7,6 +7,7 @@ import ( "golang.org/x/exp/constraints" ) +// TODO Remove on Go 1.22, in favor of builtin `min` function. func Min[T constraints.Ordered](vs ...T) T { if len(vs) == 0 { var zero T @@ -21,6 +22,7 @@ func Min[T constraints.Ordered](vs ...T) T { return min } +// TODO Remove on Go 1.22, in favor of builtin `max` function. func Max[T constraints.Ordered](vs ...T) T { if len(vs) == 0 { var zero T