Find the Min or Max Value in a Slice (New to Go 1.21)
The latest Go release, 1.21, has introduced two new built-in functions: min() and max(). These functions have long been used in many other languages, such as Python and JavaScript, and are now welcome additions to Go.
The min() and max() functions have been introduced to simplify the process of finding the smallest and largest numbers in a set, respectively. There was plenty of talk as to whether these should be included as “built-ins” or introduced into the cmp package.