var typesMap = map[string]reflect.Value{ "A": reflect.ValueOf(A{}), "B": reflect.ValueOf(B{}),}
type Mixed struct{
A *A
B *B
}
type Info struct{
typeStr string // store the type info to decode IData
IData interface{}
}
type infoType int
const (
firstType infoType = iota
secondType
...
)
type Info struct{
infoType
IData interface{}
}
There is no int8, int16 etc. discrimination in the gob format; there are only signed and unsigned integers.