Go问答技术文章
-
Golang · Go问答 | 2个月前 | HTTP · net/http · Go问答 · 流式响应 · net/http FLUSH 流式响应 Go问答 ResponseController FullDuplex 写超时
用问答方式解释 Go net/http ResponseController 的定位、Flush、写入 deadline、FullDuplex 支持边界、兼容兜底和生产使用注意事项。161 收藏 -
Golang · Go问答 | 2个月前 | HTTP · sse · Go问答 · 用户体验 · 流式响应 · Go EventSource SSE Go问答 Server-Sent Events 长任务进度 http.Flusher
用 Go net/http 实现一个长任务进度 SSE 接口,讲清任务提交、事件格式、http.Flusher、浏览器 EventSource、心跳保活、断开取消和资源清理。293 收藏 -
Golang · Go问答 | 2个月前 | Timer · 性能优化 · time.After · Go问答 · Go 内存优化 Timer time.After Go问答 time.NewTimer Go1.23
解释 Go time.After 在循环里的资源占用问题,区分 Go 1.23 前后的 Timer 语义变化,并给出 time.After、time.NewTimer、Stop 和 Reset 的工程选择建议。384 收藏 -
Golang · Go问答 | 2个月前 | go · Context · 并发编程 · 超时控制 goroutine泄漏 WithTimeout Go context Go问答 CancelFunc
从接口超时、下游取消和 goroutine 泄漏治理角度,解释 Go context 的使用价值、风险边界、采用路径和观察指标。477 收藏 -
回答 Go 并发读写 map 应该选 map+RWMutex、sync.Map 还是分片 map,按读写比例、热点键、维护成本和扩展性给出选择规则与代码示例。244 收藏