> One generic reason to use a specific type (heh) is to avoid resolving the interface on every use.
Aren't Go interface checked at compile time? I thought only interface casting happened at runtime.
Aren't Go interface checked at compile time? I thought only interface casting happened at runtime.
I imagine it also prevents inlining in most or all situations. (I don't know exactly how hard the compiler will try to notice that something is nominally in an interface value but it can be sure it is actually a concrete type. My guess is "not at all".) Given that inlining is Go's big optimization technique, that can be another generic reason to use a specific type instead of an interface.
And thanks for the link! That should be useful to make a decision on what to do in that issue.