3 ms·
I think reread the first paragraph about Go embeddings and method promotion to get a better idea of what he means by embedding. It sounds more record extension,
by naasking 3y ago
I think reread the first paragraph about Go embeddings and method promotion to get a better idea of what he means by embedding. It sounds more record extension, so your C# example doesn't have the property he's talking about.
- gabereiser 3y agoThis is correct. The last example of adding a Person property to Employee isn’t the same as Go’s struct embedding where Employee gets the fields and structure of Person.