[Go] assignment count mismatch 1 = 2

通过llama.cpp与羊驼聊天的网页界面- 详解 Serge 的启动使用

 

Golang 中这个错误的的意思是赋值变量的数目不匹配。

 

举例:

result := json.Marshal(List)

由于没有给返回值中的 error 正确赋值,就会报  assignment count mismatch 1 = 2

 

正确写法:

result, _ := json.Marshal(List)

 

Refer:常见Golang错误

Refer:在线运行Golang代码

Link:https://www.cnblogs.com/farwish/p/13046595.html

posted on 2020-06-04 21:22  ercom  阅读(3454)  评论(0编辑  收藏  举报