> Although methods of a generic type may use the type's parameters, methods may not themselves have additional type parameters. Where it would be useful to add type arguments to a method, people will have to write a suitably parameterized top-level function.
> This is not a fundamental restriction but it complicates the language specification and the implementation.
And, for generality, you should write the method actually as follows.
However, you will get the error message then: According to https://go.googlesource.com/proposal/+/refs/heads/master/des... this seems an intended restriction:> Although methods of a generic type may use the type's parameters, methods may not themselves have additional type parameters. Where it would be useful to add type arguments to a method, people will have to write a suitably parameterized top-level function.
> This is not a fundamental restriction but it complicates the language specification and the implementation.
For now, we have to write it as https://go2goplay.golang.org/p/mGOx3SWiFXq and I feel it rather inelegant. Good grief