Go——报错总结
前言
前端时间抽时间看完了Go基础的一些内容,后面接着学习,记录一些错误。
错误
cannot refer to unexported name fmt.println
报错信息:
# 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报错
### 错误代码-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
报错信息:
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
Go——报错总结的更多相关文章
- Windows 7上执行Cake 报错原因是Powershell 版本问题
在Windows 7 SP1 电脑上执行Cake的的例子 http://cakebuild.net/docs/tutorials/getting-started ,运行./Build.ps1 报下面的 ...
- 关于VS2015 ASP.NET MVC添加控制器的时候报错
调试环境:VS2015 数据库Mysql WIN10 在调试过程中出现类似下两图的同学们,注意啦. 其实也是在学习的过程中遇到这个问题的,找了很多资料都没有正面的解决添加控制器的时候报错的问题,还是 ...
- php报错 ----> Call to undefined function imagecreatetruecolor()
刚才在写验证码的时候,发现报错,然后排查分析了一下,原来是所用的php版本(PHP/5.3.13)没有开启此扩展功能. 进入php.ini 找到extension=php_gd2.dll ,将其前面的 ...
- scp报错 -bash: scp: command not found
环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...
- VS2015使用scanf报错的解决方案
1.在程序最前面加: #define _CRT_SECURE_NO_DEPRECATE 2.在程序最前面加: #pragma warning(disable:4996) 3.把scanf改为scanf ...
- VS项目中使用Nuget还原包后编译生产还一直报错?
Nuget官网下载Nuget项目包的命令地址:https://www.nuget.org/packages 今天就遇到一个比较奇葩的问题,折腾了很久终于搞定了: 问题是这样的:我的解决方案原本是好好的 ...
- Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架
SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...
- Android——eclipse下运行android项目报错 Conversion to Dalvik format failed with error 1解决
在eclipse中导入android项目,项目正常没有任何错误,但是运行时候会报错,(clean什么的都没用了.....)如图: 百度大神大多说是jdk的问题,解决: 右键项目-Properties如 ...
- 报错:You need to use a Theme.AppCompat theme (or descendant) with this activity.
学习 Activity 生命周期时希望通过 Dialog 主题测试 onPause() 和 onStop() 的区别,点击按钮跳转 Activity 时报错: E/AndroidRuntime: FA ...
- 镜像切换Logreader Agent报错:分发数据库中可能存在不一致的状态(续)
报错: 分发数据库中可能存在不一致的状态: dist_backup_lsn {00000030:000001ba:0004},dist_last_lsn {00000030:000001cd:0004 ...
随机推荐
- JS实现文字转语音播放
JS实现文字转语音播放背景实现方式第一种:百度文字转语音开放API第二种:微软TTS语音引擎第三种:SpeechSynthesisUtterance总结背景在做项目的过程中,经常会遇到场景是客户要求播 ...
- MATLAB 安装 cvx 工具箱
步骤: matlab本身是没有cvx的工具箱,需要到[cvx主页],「http://cvxr.com/cvx/」上下载,菜单上有个「download」,进入后选择适合你的版本下载: 将cvx压缩包解压 ...
- 24H玩转 Grafana 被工程师称相当专业,如何做到?
国庆假期发生了两件小事,其一是我默默度过 35 周岁生日,其二是玩了下grafana `并在节后第一天被工程师 M 称赞:相当专业. 1.我为什么要玩 grafana 呢? 数月前我提交了一份数据后台 ...
- Mybatis中使用collection进行多对多双向关联示例(含XML版与注解版)
Mybatis中使用collection进行多对多双向关联示例(含XML版与注解版) XML版本: 实体类: @Data @NoArgsConstructor public class Course ...
- requirejs:模块加载(require)及定义(define)时的路径理解
给新来的实习生普及下JS基本知识,看到比较好的文章 转载https://blog.csdn.net/xuxiaoping1989/article/details/52384778 接触过require ...
- 服务注册发现(一) Consul 简介及 windows版本的安装与部署
Consul是一个用来实现分布式系统的服务发现与配置的开源工具.他主要由多个组成部分: 服务发现:客户端通过Consul提供服务,类似于API,MySQL,或者其他客户端可以使用Consul发现服务的 ...
- vue+element 按钮来回切换
需求很简单,实现很容易,日常记录一下 templace代码: data数据声明: me'thods方法:
- base64的使用
import base64with open("test.jpg", "rb") as f: file = f.read()file_base64 = base ...
- Vue常用工具类方法 总结
1.利用Cookie,来设置接口携带的‘token’ 执行命令npm install js-cookie,在js工具类中引入, /** @format */ import Cookie from 'j ...
- Maven项目命名规范
Guide to naming conventions on groupId, artifactId and versiongroupId will identify your project uni ...