Files
lo/docs/data/core-max.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

634 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Max max find.go#L410 core find https://go.dev/play/p/wYvG8gRRFw-
core#find#max
core#find#min
core#find#maxby
core#find#minby
core#find#maxindex
core#find#minindex
core#find#maxindexby
core#find#minindexby
core#math#sum
core#math#mean
core#math#product
core#math#mode
200
func Max[T constraints.Ordered](collection []T) T

Searches the maximum value of a collection. Returns zero value when the collection is empty.

max := lo.Max([]int{2, 5, 3})
// 5