如果我有:
type foo struct{ } func bar(baz interface{}) { }
以上是一成不变的 - 我无法改变foo或bar.另外,baz必须转换回bar内的foo结构指针.如何将&foo {}转换为接口{},以便在调用bar时将其用作参数?
struct pointers interface go
go ×1
interface ×1
pointers ×1
struct ×1