首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >Go——报错总结

Go——报错总结

作者头像
思索
发布2024-08-16 12:22:42
发布2024-08-16 12:22:42
2660
举报

前言

前端时间抽时间看完了Go基础的一些内容,后面接着学习,记录一些错误。

错误

cannot refer to unexported name fmt.println

报错信息:

代码语言:javascript
复制
# basic
.\main.go:6:2: cannot refer to unexported name fmt.println    //不能够引用未导出的名称fmt.println
.\main.go:6:2: undefined: fmt.println    //未定义的:fmt.println

原因:

嗯,Go中其实有规定的就是模块中要导出的函数,必须首字母大写,所以错误的原因就是fmt.Println()写成了fmt.println()

bee报错

代码语言:javascript
复制
### 错误代码-0001
Administrator@King MINGW64 /d/wamp/www/GoLearn/src/myapp
$ bee run myapp
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2019/07/23 16:23:35 FATAL    ▶ 0001 No application 'D:\wamp\www\GoLearn\src\myapp\myapp' found in your GOPATH


### 错误代码-0003
$ bee run myapp/
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2019/07/23 16:25:50 INFO     ▶ 0001 Using 'myapp' as 'appname'
2019/07/23 16:25:50 INFO     ▶ 0002 Initializing watcher...
can't load package: package .: no Go files in D:\wamp\www\GoLearn\src
2019/07/23 16:25:50 ERROR    ▶ 0003 Failed to build the application: can't load package: package .: no Go files in D:\wamp\www\GoLearn\src

原因: 
> 报错里面的提示很清楚,所有修改GOPATH或者进入到应用目录直接`bee run`


### 错误代码-0003
Administrator@King MINGW64 /d/wamp/www/GoLearn/src/myapp
$ bee run
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v1.10.0
2019/07/23 16:26:43 INFO     ▶ 0001 Using 'myapp' as 'appname'
2019/07/23 16:26:43 INFO     ▶ 0002 Initializing watcher...
main.go:5:2: cannot find package "github.com/astaxie/beego" in any of:
        D:\Program Files\Go\src\github.com\astaxie\beego (from $GOROOT)
        D:\wamp\www\GoLearn\src\github.com\astaxie\beego (from $GOPATH)
2019/07/23 16:26:44 ERROR    ▶ 0003 Failed to build the application: main.go:5:2: cannot find package "github.com/astaxie/beego" in any of:
        D:\Program Files\Go\src\github.com\astaxie\beego (from $GOROOT)
        D:\wamp\www\GoLearn\src\github.com\astaxie\beego (from $GOPATH)

>缺少对应的引入文件`github.com/astaxie/beego`,重新`go get github.com/astaxie/beego`即可

go get 报错 cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

报错信息:

代码语言:javascript
复制
D:\wamp\www\GoLearn>go get github.com/mattn/go-sqlite3
# github.com/mattn/go-sqlite3
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

原因:

GCC编译器版本不是64位的,访问https://sourceforge.net/projects/mingw-w64/下载个64位的把环境变量配置好,安装教程https://www.cnblogs.com/findumars/p/8289669.html

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-07-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 前言
  • 错误
    • cannot refer to unexported name fmt.println
    • bee报错
    • go get 报错 cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档