Get the latest tech news

Be careful with Go struct embedding


The gophers nested too greedily and too deep.

Go has a feature called struct embedding that allows you to compose types. I would expect this to fail to compile as URL is ambiguous. This happened at the day job, although it was caught in a test.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Struct

Struct

Related news:

News photo

Implementing a Struct of Arrays