RunQuery应该返回接口,否则你总是要处理强类型。
AnyDB不是必需的,我为此添加了内容。
AnyResult应该在
bar包中定义或导入其中。
type AnyDB interface { RunQuery() AnyResult}type MySQL struct{}func (m *MySQL) RunQuery() AnyResult { return &MySQLResult{}}type AnyResult interface { Result() string}type MySQLResult struct{}func (r *MySQLResult) Result() string { return "foo"}


