go .\main.go:13:2: cannot refer to unexported name fmt.println .\main.go:13:2: undefined: fmt.println 解决方法
2021-01-04 15:40
826 查看
一、报错现象:
二、报错原因:
报错信息翻译过来:不能引用未报告的名称 fmt.println
一听就是语法错误。
又重新敲了一下,自动补全功能暴露了报错原因:自动补全的,首字母都是大写。
查了一下,原来是go语言大小写的问题:Go语言区分大小写,模块中要导出的函数,首字母必须大写。
三、解决
函数首字母改成大写就好了。
初入职场热爱分享的打工人一枚,请大家多多指教,么么哒~
相关文章推荐
- Go语言中cannot convert adminname (type interface {}) to type *: need type assertion的解决办法
- ImportError: cannot import name 'render_to_response' 解决方法
- Go语言中cannot convert adminname (type interface {}) to type *: need type assertion的解决办法
- Intellij IDEA ,按Ctrl+左键,不能进入类或方法的【解决办法】,提示Cannot find declaration to go to
- IDEA提示cannot find declaration to go to 解决方法
- Cannot make a static reference to the non-static method的解决方法 分类: JAVA 2012-09-13 12:01 8386人阅读 评论(0
- pip install 下载时出现的bug| pip升级后Import Error:cannot import name main解决方法
- idea 提示cannot find declaration to go to 解决方法
- 关于错误“Cannot connect to the Citrix MetaFrame server.Can't assign requested address”的解决方法
- undefined reference to错误的解决方法
- undefined reference to `img_convert’的解决方法
- QT for linux 的错误 undefined reference to 'FcFreeTypeQueryFace' 的解决方法
- 出现500错误[code=CANT_CONNECT_LOOPBACK] Cannot connect due to potential loopback problems的解决方法
- Linux makefile -- undefined reference to 问题解决方法
- undefined reference to" 问题解决方法
- Fatal error: Call to undefined function curl_init()解决方法
- Qt 调用phonon 在xp下不能播放视频的解决方法(Phonon::createPath: Cannot connect Phonon::MediaObject ( no objectName )...)
- java.sql.SQLException: The value supplied cannot be converted to DECIMAL 解决方法
- undefined reference to error解决方法
- kde下sudo出现cannot connect to xserver解决方法