|
|
|
|
|
by wyager
4428 days ago
|
|
>using Go interfaces to handle most generic type problems Do you mean Go interface specifications, or the Go interface{} type? Because the latter is the top type. Using it is equivalent to casting things to Object in Java, which people did up until 2004 when they realized it was really stupid. You also can't use Go interface specifications to make generic data structures, which is the really important use case. |
|
You can easily use interface{} to make generic data structures, but interfaces have a time/space/code-complexity cost which makes them not worth it most of the time.