[FAQ] "cannot refer to unexported name" in Golang ?

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

 

Golang 项目中如果使用了其它模块中找不到的函数、常量等,都会提示 "cannot refer to unexported name"。

 

遇到这种情况,要么是拼写错误了,要么是首字母大小写写错了。

Golang 文件内,首字母大写的函数、常量等 可以被其它模块访问,首字母小写的只能在当前文件中可以使用。

 

Refer:Golang unexpected

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

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