Golang的开发中,我们经常会手写一些结构体Struct,其实是有不少比较好的tool来释放我们的双手,更多的去聚焦业务功能的实现。为了避免长期的加班“内卷”,996/007的工作,需要不断收集提效工具,大幅度提升自己的开发效率。
以下工具是我平时在Golang开发过程中比较常用的 ,以此篇文章做个总结。
1 JSON-to-Go
Convert json to Go struct
This tool instantly converts JSON into a Go type definition. Paste a JSON structure on the left and the equivalent Go type will be generated to the right, which you can paste into your program. The script has to make some assumptions, so double-check the output!
地址:https://mholt.github.io/json-to-go/
2 YAML-to-Go
Convert YAML to Go struct
This tool instantly converts YAML into a Go type definition. Paste a YAML structure on the left and the equivalent Go type will be generated to the right, which you can paste into your program. The script has to make some assumptions, so double-check the output!
3 TOML-to-Go
Convert TOML to Go struct
This tool instantly converts TOML into a Go type definition. Paste a TOML structure on the left and the equivalent Go type will be generated to the right, which you can paste into your program. The script has to make some assumptions, so double-check the output.
地址:https://xuri.me/toml-to-go/
4 curl-to-Go
Convert curl command to Go code.
This tool turns a curl command into Go code.
地址:https://mholt.github.io/curl-to-go/
5 SQL-to-GORM
Convert SQL to Gorm struct
地址:https://www.printlove.cn/tools/sql2gorm/