找回密码
立即注册
搜索
热搜: Java Python Linux Go
发回帖 发新帖

3287

积分

0

好友

441

主题
发表于 昨天 21:59 | 查看: 3| 回复: 0

GopherCon 2026 将于 8 月 3 日至 6 日在西雅图召开,门票现已开售。本次大会包含由 Bill Kennedy、Johnny Boursiquot 等资深专家主持的工作坊,整体日程也在持续完善,所有主题演讲的最终名单预计下周公布。

GopherCon 2026宣传海报

GopherCon 是全球 Go 语言社区最具影响力的年度技术盛会,汇集世界各地的开发者、专家和爱好者,共同探讨 Go 的最新特性、生态发展与生产实践。

Seattle Convention Center | Summit
Monday, August 3 - Thursday, August 6, 2026
https://www.gophercon.com/

零配置 Go 堆内存分析

Go 的 runtime 内置了内存分析器,可自动对堆分配进行采样,从而获取运行程序的堆内存快照。但如果没有 import runtime/pprofnet/http/pprof,链接器会禁用该功能,导致拿不到堆分析数据。本文介绍一种无需修改源程序的方法——利用 runtime.mbuckets 持续捕获运行中 Go 进程的堆内存,实现对未引入 pprof 程序的分析。

Zero-config Go heap profiling
https://coroot.com/blog/zero-config-go-heap-profiling/

简要新闻

Go 语言的新提案

Go 联合设计者 Robert Griesemer 提议为 go/constant 包新增 StringLen 函数,其作用是在不调用 StringValue(避免额外字符串分配)的前提下直接获取字符串长度。

提案#79042 Go constant StringLen函数

proposal: go/constant: add StringLen function #79042
Open
https://github.com/golang/go/issues/79042

另一项议题讨论错误信息是否应被明确排除在 Go 1 兼容性承诺之外。提案者以 net/http 中一条无法修改的错误信息为例,指出当前规范存在模糊地带。

提案#78991 错误信息从兼容性承诺排除

proposal: explicitly exclude error messages from the Go 1 compatibility promise #78991
https://github.com/golang/go/issues/78991

Go 安全团队的 Neal Patel 提议为 crypto/tls 包引入“配置文件”(Profiles)功能,以此约束 tls.Config 中大量可选项的配置范围,向更安全的默认配置靠拢。

提案#79043 crypto/tls Profiles

proposal: crypto/tls: Profiles #79043
https://github.com/golang/go/issues/79043

Gojit:在 Go 中复兴 JIT 编译器

大多数场景下 Go 的 AOT 编译让 JIT 显得多余,但如果你想编写高效的模拟器或解释器呢?该项目延续了 2014 年的 GoJIT 实验,并重点解决了 JIT 生成代码回调 Go 函数时引发 GC 崩溃的问题。

aabalke/gojit: Jit Compiler for Golang
aabalke/gojit is a revival of nelhage/gojit and rasky/gojit, providing jit compilation for Golang version 1.17+. The major functionality this fork adds is the ability for Go functions to be called from jit code, without causing errors from stack checks during garbage collection or stack growth.
https://github.com/aabalke/gojit

三十年之后,FastCGI 依然是反向代理的优秀协议

诞生于 1996 年的 FastCGI 协议看似古老,但在反向代理场景下,相较于现代的 HTTP/1.1 和 HTTP/2,它在安全性、可靠性和性能方面仍有显著优势。Go 的标准库也提供了原生支持,只需一行修改即可尝试。

反向代理协议选择决策流程图

技术文章

日志库选型:Slog、Zerolog、Zap 等对比

文章详细对比了 Go 生态中主流的日志库,提供了 Native API 下的性能基准数据。

Choosing a Go Logging Library in 2026
For most of Go's history, picking a logging library meant choosing between Logrus, zap, zerolog, and a handful of others that each brought their own API, idioms, and opinions about how structured logging should work.
https://www.dash0.com/guides/golang-logging-libraries

Go日志库性能基准对比

用纯 Go 构建 TCP‑over‑UDP 协议栈

为名为 Pilot Protocol 的 P2P AI 代理网络,作者从零实现了用户空间可靠传输栈,充分体现了 Go 在并发原语与标准库深度上的优势。

Building a reliable userspace transport stack from scratch is a formidable challenge, but the Go programming language provides the exact concurrency primitives and standard library depth needed to pull it off. We recently relied entirely on pure Go to build Pilot Protocol (created by Calin Teodor at Vulture Labs), a peer-to-peer overlay network designed to provision autonomous AI agents with persistent, routable 48-bit virtual addresses.
https://pilotprotocol.network/blog/userspace-tcp-over-udp-stack-pure-go

简明解释 sync.Mutex

一篇清晰梳理互斥锁工作机制的入门文章,从锁的基本概念入手,解释 Go 中 sync.Mutex 如何保证互斥访问。

Mutexes in Go
A lock system like the one we've described ensures mutually exclusive access to some data value, such as book abc. In other words, if I have access to it, that excludes you having access to it, and vice versa. In the jargon, then, the lock object that ensures this mutual exclusion is called a mutex.
https://bitfieldconsulting.com/posts/sync-mutex

深入探究 Go 结构体标签

结构体标签(struct tags)是字段旁边的小注解,众多第三方库通过它们来决定对字段的处理方式,最典型的应用就是 JSON 的序列化和反序列化。

Struct tags in Go are these little annotations that you stick beside struct fields. Libraries read them to decide what to do with each field, and the most familiar place you'll see them is JSON marshalling and unmarshalling:
https://rednafi.com/go/struct-tags/

代码工具

高性能 HTTP 基准测试工具 Plow 1.4

Plow 底层基于 fasthttp,提供 TUI 与 Web UI 双重界面展示测试结果,也可通过 Homebrew 或 Docker 快速运行。

https://github.com/six-ddc/plow

Plow HTTP基准测试实时图表

基于属性的现代测试库 Rapid 1.3

Rapid 通过大量自动生成的测试用例验证你定义的属性,并在发现失败时自动最小化错误用例,方便调试。

https://github.com/flyingmutant/rapid

可组合身份认证库 Limen

Limen 以插件方式实现鉴权功能,内置会话管理、Cookie 处理、速率限制等基础能力,同时可按需集成用户名/密码、OAuth 2.0、2FA 等方案。

https://github.com/thecodearcher/limen
https://limenauth.dev/blog/introducing-limen

其他重要更新

  • MongoDB Go Driver 2.6:官方驱动,新增智能工作负载管理(IWM)和入站连接速率限制支持。
  • Go-MySQL-Driver 1.10:适用于 database/sql 的 MySQL 驱动,一年来首个重要版本,已针对 Go 1.22+ 进行现代化。
  • bleve 2.6:功能全面的文本/数值/地理空间/向量索引库。
  • Chroma 2.24:纯 Go 语法高亮器,新增/更新了多个词法分析器。
  • rqlite 10.0:基于 SQLite 的容错数据库,由 Go 驱动。
  • fsnotify v1.10.0:跨平台文件系统通知库。
  • gog 0.14:用于 Gmail、日历、云端硬盘等 Google 服务的命令行界面。
  • Fiber 3.2:受 Express 启发的 Web 框架。

感谢阅读本期云栈社区的 Go 技术周报。




上一篇:Bun 实验性支持 Android:在手机上原生运行 Claude Code 等 JS 项目
下一篇:苹果Q2财报超预期,库克为何对内存成本上升三缄其口
您需要登录后才可以回帖 登录 | 立即注册

手机版|小黑屋|网站地图|云栈社区 ( 苏ICP备2022046150号-2 )

GMT+8, 2026-5-3 00:28 , Processed in 1.118945 second(s), 41 queries , Gzip On.

Powered by Discuz! X3.5

© 2025-2026 云栈社区.

快速回复 返回顶部 返回列表