shad-go/lectures/08-generics/min/generic/min.go
2022-04-07 18:04:16 +03:00

10 lines
138 B
Go

package generic
import "golang.org/x/exp/constraints"
func min[T constraints.Ordered](x, y T) T {
if x < y {
return x
}
return y
}