lan*_*ng2 3 go

fmt.Printf()struct
type Foo struct {
   a int
   b string
}
fmt.Printf(foo.a, foo.b).Bar structfmt.Printf(bar.a, bar.b, bar.c)

所以我想写一个这样的函数:

func MyPrint(obj interface{})
MyPrint(foo)MyPrint(bar)foo
...
fmt.Printf(foo.a, foo.b)
bar
...
fmt.Printf(bar.a, bar.b, bar.c)
call(*list)