I don't think `constraint` was ever removed. We had `contract` in the design at some point, and some people suggested to add `constraint` to replace it, but it never got done, so it could never have been removed.
As to the reason why `contract` was removed and why `constraint` was not added: When we used two different words for interface-types and contracts to constrain type-parameters, people where complaining that the two are really the same thing - a way to express a subset of types. So, in response to those complaints, `contracts` where removed and instead interfaces where expanded to make up the difference. Then people complained that we used the same name for two different things. Point is, interfaces and constraints are apparently sufficiently similar, that many people want to use the same name. And sufficiently different, that many people want to use different names. They can't both have their way. On Sun, Mar 20, 2022 at 6:28 AM xie cui <cuiwei...@gmail.com> wrote: > in the period of typeparam development, we have try to add a keyword > constraint, why we remove it finally, i am trying to understand why to add > it and why to remove int finally. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/ef365a2e-2ffc-49b7-b7d6-4f660011f611n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/ef365a2e-2ffc-49b7-b7d6-4f660011f611n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAEkBMfEDJWC46xX9XsDohX3Hrru1OoQyztzT8dnScpimQYupAg%40mail.gmail.com.