1
Go 常用的包推荐 (持续更新)
source link: https://forrestsu.github.io/posts/go/golang-recommend-pkgs/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Go 常用的包推荐 (持续更新)
2020年11月17日
| 字数
651
|
Go
| 阅读 55
1 Go 常用工具包推荐
- 1 stringer 为枚举量生成String()方法
go install golang.org/x/tools/cmd/stringer
- 2 pretty 格式化打印任意 go 对象,开发测试打印大对象,非常有用 (这样就不用json.Marshal再打印)
go install github.com/kylelemons/godebug
- 3 GoMock
2 常用开发库
3 测试框架
Go 版本管理: GoUP工具
a)按照 goup 工具
go install github.com/owenthereal/goup/cmd/goup@latest
b)设置环境变量(zsh)
$ echo 'export PATH="$HOME/.go/current/bin:$PATH"' >> ~/.zshrc
c)安装并使用
# 安装Go版本
$ goup install 1.17.7
$ goup install 1.18beta2
# 设置默认版本
$ goup default 1.17.7
changelist
- 2022-02-13 增加 goup 使用
- 2021-06-10 增加 go-set 使用
- 2020-11-17 初始版本
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK