![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
happyleh
这个作者很懒,什么都没留下…
展开
-
go如何进行单元测试
测试单个文件:go test -v cal_test.go cal.go测试单个方法:go test -v test.run TestAddUpper执行所有测试:go test -v原创 2020-08-19 20:02:38 · 275 阅读 · 0 评论 -
go 在mac下编译liunx能运行的程序
在mac下直接使用go build编译出来的文件在linux下无法运行,因此需要使用其他方法编译,执行下面的命令即可:CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build test.go该命令会下载相应的包:go: downloading github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a这个命令需要从github上下东西,一般情况下是会下载失败,所以直接下载源码,地址为:https:原创 2020-07-24 11:50:52 · 5073 阅读 · 0 评论