3 ms·
This can be simplified, conflicting field names at the same level also don't compile: https://go.dev/play/p/D3eFi9_can8 https://go.dev/play/p/D3eFi9_can8 Conf
by whatevertrevor 1y ago
This can be simplified, conflicting field names at the same level also don't compile:
https://go.dev/play/p/D3eFi9_can8 https://go.dev/play/p/D3eFi9_can8
Conflicting functions at nested levels also compile:
https://go.dev/play/p/xXXDZCjQJOh https://go.dev/play/p/xXXDZCjQJOh
It's not about method vs field, it's about the nesting level of the conflicting identifier, if it's at the same level there's an error, if it's at different levels, the higher level hides the lower level identifier:
https://go.dev/doc/effective_go#embedding https://go.dev/doc/effective_go#embedding