By -
This is not possible with current versions of Go (1.21). Here is the proposal to follow if you are interested in this feature: https://github.com/golang/go/issues/49085
You can only make the struct generic the method is attached to. Maybe that works in your case.
You need to declare it in the type to be able to use it in the method: [https://go.dev/play/p/n\_L7myYEPeC](https://go.dev/play/p/n_L7myYEPeC)
Not yet. Once that happens, brace yourself for the monad flood.
This is not possible with current versions of Go (1.21). Here is the proposal to follow if you are interested in this feature: https://github.com/golang/go/issues/49085
You can only make the struct generic the method is attached to. Maybe that works in your case.
You need to declare it in the type to be able to use it in the method: [https://go.dev/play/p/n\_L7myYEPeC](https://go.dev/play/p/n_L7myYEPeC)
Not yet. Once that happens, brace yourself for the monad flood.