Add todo as a reminder to replace min/max in Go 1.22

This commit is contained in:
Deluan 2023-12-21 19:17:33 -05:00 committed by Joe Stump
parent 81bf9d23e4
commit a3ce0e9454
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

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