mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-05 05:27:37 +03:00
Add todo as a reminder to replace min/max in Go 1.22
This commit is contained in:
parent
dfcc189cff
commit
3f349b1b58
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"golang.org/x/exp/constraints"
|
"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 {
|
func Min[T constraints.Ordered](vs ...T) T {
|
||||||
if len(vs) == 0 {
|
if len(vs) == 0 {
|
||||||
var zero T
|
var zero T
|
||||||
|
@ -21,6 +22,7 @@ func Min[T constraints.Ordered](vs ...T) T {
|
||||||
return min
|
return min
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Remove on Go 1.22, in favor of builtin `max` function.
|
||||||
func Max[T constraints.Ordered](vs ...T) T {
|
func Max[T constraints.Ordered](vs ...T) T {
|
||||||
if len(vs) == 0 {
|
if len(vs) == 0 {
|
||||||
var zero T
|
var zero T
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue