It is a very special example that occurs because the encoder uses reflexion. It is not generalizable.
Note that the
encoding/json package is not the
In go we use packages to prevent collisions.
Remember that Go interfaces are implemented implicitly. There is neither explicit declaration nor “implements” keyword.