Struct literal changes while welcomed, have the issue of being a possible source of bugs, if there are overlapping fields,
type Habitat struct { Burrow string }
type Gopher struct { Name string Burrow string Habitat }
It will not initialise what one expects, here it is a contrived example, however it may not be easy to spot in more complex source code.
https://go.dev/play/p/dsY6tK5S8Ie
Better generics and improved SIMD are nice additions as well.
Mhm, probably worth a golang-ci check for duplicate field names which are accessed by methods on the embedded type.
Go has had this behaviour for promoting fields (provided they don't clash) for some time, this is just extending the language feature to initialisers.
Your contrived example doesn't initialise the embedded struct that also contains a "Burrow" field. If it did that at all, even without naming the Burrow field... you would not be allowed to initialise the struct, because of the ambiguity.
https://go.dev/ref/spec#Composite_literals
> A key must not denote a promoted field inside an embedded struct if that struct is also specified by another key.
> Given the declarations
> .... field selectors may not denote overlapping fields: