Can a Go struct inherit a set of values from a type of another struct?
Something like this.
type Foo struct {
Val1, Val2, Val3 int
}
var f *Foo = &Foo{123, 234, 354}
type Bar struct {
// somehow add the f here so that it will be used in "Bar" inheritance
OtherVal string
}
Which would let me do this.
b := Bar{"test"}
fmt.Println(b.Val2) // 234
If not, what technique could be used to achieve something similar?