Go 并发编程:channel 与 select
Don't communicate by sharing memory; share memory by communicating。深入 channel 与 select 模式。
2026-07-25阅读 →
Don't communicate by sharing memory; share memory by communicating。深入 channel 与 select 模式。
text/template 与 html/template 的自定义函数、模板继承与安全输出。
隐式接口满足, duck typing 在 Go 中的体现与最佳实践。
errors.Is/errors.As/unwrap 链,避免 if err != nil 嵌套地狱。
Context 传递超时、取消信号与请求 ID,实现分布式追踪上下文。
testing 包、table-driven test 与 benchmark,保证代码质量。
net/http 构建 REST API,中间件链处理日志、认证与恢复。
encoding/json 的 Marshal/Unmarshal 与 json 标签进阶用法。
channel + worker pool 限制并发,防止 goroutine 泄漏与资源耗尽。
go.mod 版本管理与依赖注入模式,构建可测试的 Go 应用。