|
|
|
|
|
by jerf
670 days ago
|
|
Not sure what you mean by "no generics on interfaces"? https://go.dev/play/p/jGINeUt1JTE Also echoing not sure what you mean by "no consistency in formatting or imports". It is increasingly difficult to use Go without gofmt getting run, since I have to imagine fewer and fewer people nowadays are using an editor that has neither custom support for their language nor LSP integration, and integration with gopls automatically runs goimports on save. |
|
I didn't word this very well. You can have a generic interface, and functions on that interface can refer to generic types. But you can't have a generic method on an interface that uses a different generic type. For example you can't have:
``` type YieldThing[T any] interface { Yield() T DoOperation[U any](U) } ```