我正在从烧瓶转移到 aiohttp,我需要在不支持异步的 Oracle 数据库中执行一些查询。所以我想知道如何在 aiohttp 中做到这一点?
这个怎么样?
或者还有其他(正确的)方法来做到这一点?
提前致谢!
我试图在GO中实现这种多态性
type Discoverer interface {
Discover() string
}
type A struct {
}
func (obj A) GetTest() string {
return "im in A"
}
type B struct {
A
}
func (obj B) GetTest() string {
return "im in B"
}
func (obj A) Discover() string {
return obj.GetTest()
}
func main() {
a := A{}
b := B{}
fmt.Println(a.Discover())
fmt.Println(b.Discover())
}
Run Code Online (Sandbox Code Playgroud)
现在我进入输出
im in A
im in A
Run Code Online (Sandbox Code Playgroud)
所以,我的问题是:可以在输出中看到
im in A
im in B
Run Code Online (Sandbox Code Playgroud)
没有"覆盖"发现B?
func (obj B) …Run Code Online (Sandbox Code Playgroud)