I have these types:
type Value interface{} type NamedValue struct { Name string Value Value } type ErrorValue struct { NamedValue Error er
In addition to the wonderful answer by icza.
you can simply do this:
v := NamedValue{Name: "fine", Value: 33} e := ErrorValue{NamedValue:v, Error: err}
and it works just fine. checkout the example Here