Go 1.18 adds generics to the language. In a nutshell, this allows writing code with types that can be specified later and instantiated when needed.
One last thing to note about type parameters is that they can’t be used with method arguments, only with function arguments:
or method receivers:
If we want to use generics with methods, it’s the receiver that needs to be a type parameter.
标签:about,Being,when,use,confused,generics,Go From: https://www.cnblogs.com/zhangzhihui/p/18014733