If you do the tour to learn go here :
You may try to use constraints like Ordered.
returns an error :
package constraints is not in GOROOT
"constraints" package is not part of the standard library and never was, except perhaps for early dev or beta releases before Go 1.18.
The correct import path is:
As all code in
x/exp it's outside of Go compatibility guarantee.
The reason for not including it in the standard library is mentioned here: https://github.com/golang/go/issues/50792