go语言接口实现错误 显示student2类型无法解析?-灵析社区

横刀立马007

package main type People interface { Speak(string) string } type Student2 struct{} func (stu Stduent2) Speak(think string) (talk string) { if think == "帅" { talk = "你是个大帅比" } else { talk = "您好" } return } func main() { var peo People = Student2{} think := "bitch" println(peo.Speak(think)) } 希望输出结果是 你好

阅读量:16

点赞量:0

问AI
MaxClick
注意拼写... 下面拼错了 "image.png" (https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241109/eaaab792eaf98e62856ad772f27fcd44.png)