打赏
摘要: golang easyjson使用 1.先安装easyjson go get -u github.com/mailru/easyjson/ 2.在结构体上加//easyjson:json的注解 //easyjson:json type School struct { Name string `jso 阅读全文
posted @ 2021-04-17 23:12 苍山落暮 阅读(1878) 评论(0) 推荐(0)
摘要: golang性能分析 go-torch 使用 1.)安装graphviz apt intstall graphviz 2.)安装go-torch go get github.com/uber/go-torch 下载并复制flamegraph.pl到$GOPATH/bin下 https://githu 阅读全文
posted @ 2021-04-17 22:55 苍山落暮 阅读(353) 评论(0) 推荐(0)
摘要: 分布式事务 1.常见的解决方案 1.)基于数据库XA/JTA协议的方式 2.)异步校验数据的方式 3.)基于可靠的消息(MQ)的解决方案 4.)TCC编程式解决方案 2.美团点评系统架构图 分布式事务的问题,订单系统和运单系统的数据一致性如何解决? 3.整理的设计思路 1.)首先要有一个可靠的消息生 阅读全文
posted @ 2021-04-17 21:05 苍山落暮 阅读(90) 评论(0) 推荐(0)
摘要: golang reflect使用 反射的应用场景: 1.)使用反射进行类型判断 2.)使用反射访问结构体成员和结构体方法 使用示例 1.类型判断 func CheckType(v interface{}){ t := reflect.TypeOf(v) // 通过kind来判断类型 switch t 阅读全文
posted @ 2021-04-17 20:54 苍山落暮 阅读(162) 评论(0) 推荐(0)
摘要: goconvery基本使用 (1.)项目地址 https://github.com/smartystreets/goconvery (2.)安装 go get -u github.com/smartystreets/goconvery/convery (3.)启动UI界面 $GOPATH/bin/g 阅读全文
posted @ 2021-04-17 20:39 苍山落暮 阅读(262) 评论(0) 推荐(0)