So I have this data struct:
type Parent struct {
A ChildA
B ChildB
C ChildC
D ChildD
}
type ChildA struct {
...
}
I am trying to create a helper funct such that I can reduce my LOC when it comes to variable assignment.
What I am trying to do:
func SomeHelper( SomeChild Child? ) Parent {
return Parent{
?: SomeChild
}
}
"?" can be any of the key A B C D