
golang
widon1104
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
golang 结构体赋值拷贝 函数
// 为dest在source中存在的字段自动赋值func CopyStruct(source interface{}, dest interface{}) { sByte, _ := json.Marshal(source) _ = json.Unmarshal(sByte, dest)}很简单,好使原创 2021-04-06 20:25:08 · 791 阅读 · 0 评论 -
golang 线段树实现
给出的代码可以解决leetcode 307 区域和检索 - 数组可修改题目地址:https://leetcode-cn.com/problems/range-sum-query-mutable/题解地址:https://leetcode-cn.com/problems/range-sum-query-mutable/solution/qu-yu-he-jian-suo-shu-zu-ke-xiu-gai-by-leetcode/实现语言是golang:type NumArray struc原创 2020-06-26 22:50:23 · 439 阅读 · 0 评论 -
leaf protobuf demo例子
服务端的代码可以参考:https://github.com/name5566/leaf/wiki/%E5%9C%A8-Leaf-%E4%B8%AD%E4%BD%BF%E7%94%A8-Protobuf这里面只贴客户端的代码:package mainimport ( "encoding/binary" "fmt" "net" "github.com/golang/protob...原创 2020-03-21 16:23:35 · 335 阅读 · 1 评论