![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
文章平均质量分 51
湫然Quin
这个作者很懒,什么都没留下…
展开
-
关于go:为什么json.Unmarshal为什么使用引用而不使用指针?
指针初始化值为 nil, 结构体初始化为基础值。定义指针 unmarshal 时,出现。map, slice 初始化为 nil。因为指针初始化为 nil 所以返回。原创 2023-03-31 16:20:39 · 296 阅读 · 0 评论 -
golang unmarshal & marshal 导致 cup 内存占用率过高
每次分发任务时,都会查询所有任务,导致 Unmarshal。结合线上内存分析工具 ppor 显示,当 cup 过高时,marshal & unmarshal 都会各自达到 30% 左右。有效的缩短了运行时长,但是内存使用情况,并没有优化。使用中间价保存任务信息(redis 等内存数据库)且分发任务执行次数频率较高,每分钟执行一次。当任务过多时,导致中控 cup 100%。使用分页查询,限制查询数据大小。优化数据字段,保存较少数据。原创 2023-03-27 16:10:56 · 806 阅读 · 0 评论 -
go-sql映射成非基本类型
sql: Scan error on column index 1, name \"foo\": unsupported Scan, storing driver.Value type []uint8 into type *[]string原创 2022-12-06 10:30:42 · 387 阅读 · 0 评论 -
Refactoring a Go Code into SOLID Code(将 Go 代码重构为 SOLID 代码)
使用 SOLID 重构 go 项目翻译 2022-11-14 16:17:42 · 140 阅读 · 0 评论 -
go 堆 实现
go 堆 实现原创 2022-05-23 11:01:53 · 91 阅读 · 0 评论