编译下列代码,哪些行会出现编译错误(   &...
发布于 2022-03-03 11:34:33
编译下列代码,哪些行会出现编译错误( )
package main
type Books struct {
}
func foo1(x interface{}) {
}
func foo2(x *interface{}) {
}
func main() {
s := Books{}
p := &s
foo1(s) //line:1
foo2(s) //line:2
foo1(p) //line:3
foo2(p) //line:4
}
package main
type Books struct {
}
func foo1(x interface{}) {
}
func foo2(x *interface{}) {
}
func main() {
s := Books{}
p := &s
foo1(s) //line:1
foo2(s) //line:2
foo1(p) //line:3
foo2(p) //line:4
}
登录后免费查看答案
关注者
0
被浏览
23