You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often need to create composed types to parse structured data. And I wonder if we could avoid redefining the content of the struct that we declare inside another.
@seankhliao I'm sorry, but I don't see in what it's the same topic as #35304 - what I suggest here is not about anonymous struct, but about typed struct declared in another type that needs to be redeclared in assignation.
Is there anything I badly explained? (it's possible, English isn't my mother thong)
Hello,
I often need to create composed types to parse structured data. And I wonder if we could avoid redefining the content of the struct that we declare inside another.
For example:
https://goplay.tools/snippet/DLsNoPTpvh2
The struct is like this:
Parsing a JSON file with this is OK. But, if I want to create a document with this, I need to write:
It's a pity to not be able to write it like this:
Of course, I understand that if "Data" is a slice of structs, it needs a better syntax.
That's just an idea.
The text was updated successfully, but these errors were encountered: