I have these types:
type Value interface{}
type NamedValue struct {
Name string
Value Value
}
type ErrorValue struct {
NamedValue
Error error
}
I can use use v := NamedValue{Name: "fine", Value: 33}
, but I am not able to use e := ErrorValue{Name: "alpha", Value: 123, Error: err}
Seems that embedding syntax was ok, but using it doesn't work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…