```
func main() {
//testMidAndGroup()
testI()
}
type t1 interface {
Op()
}
type t1i struct {
I int `json:"i"`
}
func (t *t1i) Op() {
fmt.Println("t1i")
}
func testI() {
var t t1 = &t1i{}
b, e := json.Marshal(t)
if e != nil {
fmt.Println(e)
return
}
var t2 t1
e = json.Unmarshal(b, &t2)
if e != nil {
fmt.Println(e)
}
}
```
如上代码, 会有json: cannot unmarshal object into Go value of type main.t1报错,请问接口如何做反序列化
更多评论