I wish I could recover my type of structure and declare a variable of that type .
I tried with Reflect but I can not find the way .
package main
import (
"fmt"
"reflect"
)
type M struct {
Name string
}
func main() {
type S struct {
*M
}
s := S{}
st := reflect.TypeOf(s)
Field, _ := st.FieldByName("M")
Type := Field.Type
test := Type.Elem()
fmt.Print(test)
}