できるはずなんだけど... 不安になったので、実験してみた。
結果:できた。
package main
import (
"fmt"
)
type a struct {
ID string
Something interface{}
}
type b struct {
ID string
}
type c struct {
ID string
Param string
}
func main() {
r := a{
ID: "test",
Something: b{
ID: "hey guy!!",
},
}
other := c{
ID: "hey girl!!",
Param: "you are awesome",
}
r.Something = other
fmt.Printf("%+v\n", r)
}