本文作者:neonliu,腾讯CSIG开发工程师neon是鹅厂高级后台开发工程师。经过多年的努力,他总结了很多效率神器,今天分享给大家。一、开发工具1)sql2go用于将sql语句转换为golang结构体。只需使用ddl语句。例如建表语句:showcreatetablexxx。将输出语句直接粘贴到其中。http://stming.cn/tool/sql2go.html2)toml2go用于将编码后的toml文本转换为golang结构。https://xuri.me/toml-to-go/3)curl2go用于将curl命令转换成具体的golang代码。https://mholt.github.io/curl-to-go/4)json2go用于将json文本转换为结构。https://mholt.github.io/json-to-go/5)mysql转ES工具http://www.ischoolbar.com/EsParser/6)golang模拟模板工具,在支持泛型之前可以考虑使用.https://github.com/cheekybits/genny7)查看某个库的依赖关系,类似golist功能https://github.com/KyleBanks/depth8)一个简单易用的文件压缩解压工具,集成了zip、tar等功能,主要是跨平台。https://github.com/mholt/archiver9)go内置命令golist可以查看某个包的依赖关系。govet可以检查代码哪里不符合golang规范。10)热编译工具https://github.com/silenceper/gowatch11)revivegolang代码质量检测工具https://github.com/mgechev/revive12)GoCallvisgolang代码调用链图工具https://github.com/TrueFurby/go-callvis13)Realize开发流程改进工具https://github.com/oxequa/realize14)Gotests自动测试用例生成工具https://github.com/cweill/gotests2.调试工具1)perf代理工具,Support内存、cpu、堆栈查看,支持火焰图。perf工具和go-torch工具,快速定位程序问题。https://github.com/uber-archive/go-torchhttps://github.com/google/gops2)dlv远程调试是基于goland+dlv的能力实现远程调试。https://github.com/go-delve/delve提供了对golang的原生支持,比gdb调试简单多了。3)网络代理工具goproxy代理支持多种协议,支持ssh穿透和kcp协议。https://github.com/snail007/goproxy4)抓包工具go-sniffertool是一个可扩展的抓包工具,可以开发自定义协议的Toolkit。现在只支持http、mysql、redis、mongodb。基于这个工具,我们开发了qapp的抓包协议。https://github.com/40t/go-sniffer5)反向代理工具,快速开放内网端口供外部使用。ngrok可以让内网服务对外调用https://ngrok.com/https://github.com/inconshreveable/ngrok6)配置生成证书,从根证书到业务端证书一键生成。https://github.com/cloudflare/cfssl7)免费证书获取工具基于acme协议,从letsencrypt生成免费证书,有效期1年,可自动续期。https://github.com/Neilpang/acme.sh8)开发环境管理工具,单机构建便携工具的强大利器。支持多个虚拟机后端。Vagrant经常被拿来和docker比较,值得拥有。https://github.com/hashicorp/vagrant9)Nomad,一个轻量级的容器调度工具,可以轻松管理容器和传统应用。与k8s相比,简直不要太简单。https://github.com/hashicorp/nomad10)敏感信息和密钥管理工具https://github.com/hashicorp/vault11)高度可配置的http转发工具,基于etcd配置。https://github.com/gojek/weaver12)进程监控工具supervisorhttps://www.jianshu.com/p/39b476e808d813)基于procFile的进程管理工具。它比主管简单。https://github.com/ddollar/foreman14)基于http、https、websocket的调试代理工具,配置功能丰富。基于此开发的在线教育网络调试工具Nohost。https://github.com/avwo/whistle15)分布式调度工具https://github.com/shunfei/cronsun/blob/master/README_ZH.mdhttps://github.com/ouqiang/gocron16)自动化运维Gaia和维护平台https://github.com/gaia-pipeline/gaia3.网络工具4.常用网站go百科:https://awesome-go.com/json解析:https://www.json.cn/导出IP:https://ipinfo.io/redis命令:http://doc.redisfans.com/ES命令主页:https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.htmlUrlEncode:http://tool.chinaz.com/Tools/urlencode.aspxBase64:https://tool.oschina.net/encrypt?type=3Guid:https://www.guidgen.com/常用工具:http://www.ofmonkey.com/五.golang常用库日志https://github.com/Sirupsen/logrushttps://github.com/uber-go/zap配置兼容json,toml、yaml、hcl等格式的Log库。https://github.com/spf13/viper存储mysql:https://github.com/go-xorm/xormes:https://github.com/elastic/elasticsearchredis:https://github.com/gomodule/redigomongo:https://github.com/mongodb/mongo-go-driverkafka:https://github.com/Shopify/sarama数据结构https://github.com/emirpasic/gods命令行https://github.com/spf13/cobra框架https://github.com/grpc/grpc-gohttps://github.com/gin-gonic/gin并发https://github.com/Jeffail/tunnyhttps://github.com/benmanns/goworker现在我们正在使用框架。虽然星数不多,但是真的很好用,当然可以用的更好。https://github.com/rafaeldias/async工具为结构体定义了实用的判断类和验证逻辑,避免业务profile编写复杂的代码。https://github.com/asaskevich/govalidatorhttps://github.com/bytedance/go-tagexprprotobuf文件动态解析接口可以实现反射相关能力https://github.com/jhump/protoreflect表达式引擎工具https:///github.com/Knetic/govaluatehttps://github.com/google/cel-go字符串处理https://github.com/huandu/xstringsratelimit工具https://github.com/uber-go/ratelimithttps://blog.csdn.net/chenchongg/article/details/85342086https://github.com/Juju/ratelimitgolangFusinglibraryfusing除了考虑频率限制外,qps,错误率等其他的也应该考虑经过考虑的。https://github.com/afex/hystrix-gohttps://github.com/sony/gobreaker表单https://github.com/chenjiandongx/go-echartstail工具库https://github.com/hpcloud/taglshi
