开发者社区> 问答> 正文

go语言 declared and not used

go语言报错: xxx declared and not used 代码类似:

var test Test type Test struct{ Name string }

func main(){ test := Text{name:"test"} }

func set(t Test){ test = t }

展开
收起
Dynastys 2021-10-21 10:44:07 627 0
1 条回答
写回答
取消 提交回答
  • test = Text{name:”test”}这个地方写错了铁子

    2021-10-21 10:44:38
    赞同 展开评论 打赏
问答分类:
Go
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Go语言路上踩过的坑 立即下载
gohbase :HBase go客户端 立即下载
Go构建日请求千亿级微服务实践 立即下载