阅读 63

go-gin-api 代码写法

package man
import fmt"
var Study = (study)nil)
type study stuct {
Name strng
}
type Sudy inteface {
Listenmessage strng) strng
}
func main) {
fmt.Println(hello world)
/maingo:5:5: cannot use *study)(nil) type *study as type Study in assignment
study does not mplement Study missing Listen method
var Study = (study)(nil
pakage stuy
type Sudy interface {
Lsten(message string string
i(
}func Speaks Study) string {
return sListen("abc"
type stu stuct {
Name strng
}
func (s stu) Listenmessage string string {
return sName + 听 " message
}
func s *stu) i( {}
func main({
message = studySpeaknew(stu)
fmtPrintln(message./main.go:19:28 cannot use newstu) (type *stu) as type studyStudy in argument to studySpeak:
stu does not implement studyStudy missing studyi method
have i(
want studyi()

原文:https://www.cnblogs.com/ymcs/p/15232405.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐