<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>零值 on Tony Bai</title><link>https://tonybai.com/tags/%E9%9B%B6%E5%80%BC/</link><description>Recent content in 零值 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Mon, 29 Dec 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E9%9B%B6%E5%80%BC/index.xml" rel="self" type="application/rss+xml"/><item><title>告别 interface{} 模拟，Go 终于要有真正的 Union 类型了？</title><link>https://tonybai.com/2025/12/29/go-community-new-sum-type-end-interface-union-types/</link><pubDate>Mon, 29 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/29/go-community-new-sum-type-end-interface-union-types/</guid><description>本文永久链接 – https://tonybai.com/2025/12/29/go-community-new-sum-type-end-interface-union-types 大家好，我是Tony Bai。 &amp;gt; “Go 什么时候支持枚举？” &amp;gt; &amp;gt; “Go 什么时候有真正的联合类型？” 这可能是 Go 语言诞生以来，被问得最多的问题之一。现有的解决方案——无论是用 const 模拟枚举，还...</description></item><item><title>Go开发者必读：JSON 的跨语言陷阱与 Go 防御指南</title><link>https://tonybai.com/2025/10/09/json-isnt-json/</link><pubDate>Thu, 09 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/09/json-isnt-json/</guid><description>本文永久链接 – https://tonybai.com/2025/10/09/json-isnt-json 大家好，我是Tony Bai。 JSON (JavaScript Object Notation)，以其简洁、轻量、人类可读的特性，早已成为 Web API 和系统集成的“通用语”。它的承诺是：“一次编写，随处解析”。然而，这份看似美好的承诺背后，隐藏着一个被许多开发者忽略的残酷现实：**...</description></item><item><title>超越零值：Go 语言“构造模式”深度指南</title><link>https://tonybai.com/2025/09/12/go-constructor-pattern-guide/</link><pubDate>Fri, 12 Sep 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/09/12/go-constructor-pattern-guide/</guid><description>本文永久链接 – https://tonybai.com/2025/09/12/go-constructor-pattern-guide 大家好，我是Tony Bai。 Go 语言的设计哲学崇尚简约与直白(straightforward)。其中，结构体字面量 (Struct Literal) 的存在，让我们可以用极其简单的方式创建数据结构。然而，在构建大型、复杂的系统时，这种简单性也可能成为一把双...</description></item><item><title>写出Go标准库级别文档注释的十个细节</title><link>https://tonybai.com/2024/10/27/ten-details-when-using-documentation-comments/</link><pubDate>Sun, 27 Oct 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/10/27/ten-details-when-using-documentation-comments/</guid><description>写出Go标准库级别文档注释的十个细节 | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章列表 写出Go标准库级别文档注释的十...</description></item><item><title>JSON包新提案：用“omitzero”解决编码中的空值困局</title><link>https://tonybai.com/2024/09/12/solve-the-empty-value-dilemma-in-json-encoding-with-omitzero/</link><pubDate>Thu, 12 Sep 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/09/12/solve-the-empty-value-dilemma-in-json-encoding-with-omitzero/</guid><description>JSON包新提案：用“omitzero”解决编码中的空值困局 | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章列表 JSO...</description></item><item><title>Go：值与指针</title><link>https://tonybai.com/2023/05/05/go-value-and-pointer/</link><pubDate>Fri, 05 May 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/05/05/go-value-and-pointer/</guid><description>本文永久链接 – https://tonybai.com/2023/05/05/go-value-and-pointer 1\. 计算机中的值 ---------- 在百万年的演化历史中，人类对事物的属性进行了抽象，有了数量、精度、信息等概念的表示，对应的我们称之为整数、小数、文本文字等。计算机出现后，我们使用计算机对真实世界的问题进行建模，通过计算机的高效计算解决这些问题并输出答案。为了建模，计...</description></item><item><title>使用具名返回值巧妙解决泛型函数返回零值的问题</title><link>https://tonybai.com/2022/05/20/solving-problems-in-generic-function-implementation-using-named-return-values/</link><pubDate>Fri, 20 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/20/solving-problems-in-generic-function-implementation-using-named-return-values/</guid><description>本文永久链接 – https://tonybai.com/2022/05/20/solving-problems-in-generic-function-implementation-using-named-return-values Go语言泛型语法特性在Go 1.18版本落地后，不出所料，在github上看到大量的基础容器类型数据结构被用泛型重写。这种重写我觉得是很正常、很自然的，并且实现良好...</description></item></channel></rss>