go_weekly_2025-10-18

2025-10-15 00:00

原文链接

精选

1. 15 Go Subtleties You May Not Already Know

深入解析 Go 语言中 time.After、nil 接口、json 标签等 15 个容易被忽略的特性细节。


2. How Slow is Channel-Based Iteration?

通过基准测试证明基于 channel 的迭代性能较差,推荐使用 iter.Pull 替代方案。


3. A Modern Approach to Preventing CSRF/CORF in Go

Go 1.25 引入 http.CrossOriginProtection 中间件,使用安全标头而非令牌防御跨站请求伪造攻击。


4. CPU Cache-Friendly Data Structures in Go: 10x Speed with Same Algorithm

通过优化数据结构布局提升 CPU 缓存命中率,相同算法可获得 10 倍性能提升。


5. Excelize 2.10: A Pure Go Way to Work with Excel Spreadsheets

纯 Go 实现的 Excel 文件处理库,支持读写多种格式,功能完善且持续更新。


其它

1. Gist of Go: Atomics

详解 sync/atomic 包的无锁原子操作,实现线程安全的并发编程模式。


2. Sift: A Lightweight Terminal UI for Displaying Go Test Results

轻量级终端 UI 工具,可折叠展示 Go 测试 JSON 输出,提升测试结果可读性。


3. Goiaba: An Experimental Go Parser and Compiler in Rust

用 Rust 编写的实验性 Go 解析器和 WebAssembly 编译器,主要用于学习目的。


4. Huh 0.8

Charm 终端表单和提示库,v0.8 支持自定义 Field 类型,增强终端交互体验。


5. Oto 3.4: Low-Level Cross-Platform Sound Library

底层跨平台音频库,被 Ebitengine 游戏引擎采用,支持从桌面到游戏主机的多种平台。