随笔分类 -  go

摘要:VSCode安装go相关插件 安装go tools失败,在powershell终端运行以下命令 1、mkdir -p $env:GOPATH/src/golang.org/x/ 2、cd $env:GOPATH/src/golang.org/x/ 3、git clone https://github 阅读全文
posted @ 2021-06-19 11:00 酷学大叔 阅读(432) 评论(0) 推荐(0)
摘要:golang没有try...catch...的异常处理结构,而是使用defer、panic、recover来进行异常处理。 1、defer,从字面上就是延迟、延期,就是将defer后面的方法延迟到包裹该方法的方法执行返回再执行。 从上面一段代码可以看出defer有以下特性: 1)defer将方法压入 阅读全文
posted @ 2020-08-06 10:37 酷学大叔 阅读(197) 评论(0) 推荐(0)
摘要:beego框架入门安装时候超级缓慢,go get没有反应 1、windows环境: 2、macos/Linux设置环境变量: echo "export GOPROXY=https://goproxy.cn" >> ~/.profile && source ~/.profile 阅读全文
posted @ 2020-08-04 14:15 酷学大叔 阅读(1481) 评论(0) 推荐(0)