builtin: add documentation for min/max

Updates #59488

Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
Reviewed-on: https://go-review.googlesource.com/c/go/+/498495
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
Cuong Manh Le 2023-05-26 11:12:12 +07:00 committed by Gopher Robot
parent ce8146ed33
commit 2f5e2f6cc1
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,8 @@ for the language's special identifiers.
*/
package builtin
import "cmp"
// bool is the set of boolean values, true and false.
type bool bool
@ -206,6 +208,14 @@ func cap(v Type) int
// unbuffered.
func make(t Type, size ...IntegerType) Type
// The max built-in function returns the largest value of a fixed number of
// arguments of [cmp.Ordered] types. There must be at least one argument.
func max[T cmp.Ordered](x T, y ...T) T
// The min built-in function returns the smallest value of a fixed number of
// arguments of [cmp.Ordered] types. There must be at least one argument.
func min[T cmp.Ordered](x T, y ...T) T
// The new built-in function allocates memory. The first argument is a type,
// not a value, and the value returned is a pointer to a newly
// allocated zero value of that type.