<?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>Generics on Tony Bai</title><link>https://tonybai.com/tags/generics/</link><description>Recent content in Generics on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Tue, 02 Jun 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/generics/index.xml" rel="self" type="application/rss+xml"/><item><title>再见样板代码！Go 官方新提案：函数一键转接口</title><link>https://tonybai.com/2026/06/02/no-more-boilerplate-go-proposal-function-to-interface-conversion/</link><pubDate>Tue, 02 Jun 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/06/02/no-more-boilerplate-go-proposal-function-to-interface-conversion/</guid><description>本文永久链接 – https://tonybai.com/2026/06/02/no-more-boilerplate-go-proposal-function-to-interface-conversion 大家好，我是Tony Bai。 在 Go 语言日常开发中，有一个设计几乎人人写过，但写多了又让人觉得极其繁琐、甚至有些“脱裤子放屁”的样板代码。 假设你需要一个只读数据的 io.Reader...</description></item><item><title>从 Go 迁移到 Rust</title><link>https://tonybai.com/2026/05/27/migrate-go-to-rust/</link><pubDate>Wed, 27 May 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/05/27/migrate-go-to-rust/</guid><description>本文永久链接 – https://tonybai.com/2026/05/27/migrate-go-to-rust 大家好，我是Tony Bai。 在现代后端系统编程领域，Go 和 Rust 无疑是最耀眼的两大双子星。它们都拥有静态类型、编译型、单二进制文件分发等优异特性。然而，这两门语言在底层的设计哲学、运行时权衡以及开发者体验上，走向了截然不同的方向。 Matthias Endler（Cor...</description></item><item><title>十年难题终获突破：揭秘 Go 1.27 接口逃逸分析优化</title><link>https://tonybai.com/2026/05/22/go-1-27-interface-escape-analysis-optimization-breakthrough/</link><pubDate>Fri, 22 May 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/05/22/go-1-27-interface-escape-analysis-optimization-breakthrough/</guid><description>本文永久链接 – https://tonybai.com/2026/05/22/go-1-27-interface-escape-analysis-optimization-breakthrough 大家好，我是Tony Bai。 在日常的 Go 语言开发中，有这样一段极其普通、普通到闭着眼睛都能敲出来的代码： ``` val := 1000 fmt.Sprintf(&amp;#34;Result: %d&amp;#34;, v...</description></item><item><title>Robert Griesemer 亲述：只解决 90% 问题的“箭头函数”该长什么样？</title><link>https://tonybai.com/2026/05/06/robert-griesemer-on-go-arrow-functions/</link><pubDate>Wed, 06 May 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/05/06/robert-griesemer-on-go-arrow-functions/</guid><description>本文永久链接 – https://tonybai.com/2026/05/06/robert-griesemer-on-go-arrow-functions 大家好，我是Tony Bai。 在 Go 语言的演进史上，很少有一个 Issue 能像 #21498 这样，跨越 9 年时光，累积近千条评论，却依然让官方核心团队如履薄冰。 这个 Issue 的目标很单纯：**为 Go 提供一种更简洁的匿名函...</description></item><item><title>当 Go 还在追求极简时，C++ 26 却又加了四大“史诗级”新特性</title><link>https://tonybai.com/2026/03/31/go-minimalism-vs-cpp26-epic-new-features/</link><pubDate>Tue, 31 Mar 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/03/31/go-minimalism-vs-cpp26-epic-new-features/</guid><description>本文永久链接 – https://tonybai.com/2026/03/31/go-minimalism-vs-cpp26-epic-new-features 大家好，我是Tony Bai。 在这个 Go、Zig 等“小而美”新语言颇受青睐的时代，如果你去技术社区里问一句：“C++ 这门语言怎么样？” 你大概率会得到一堆充满戏谑的回答：“太复杂了，别学”、“从入门到放弃”、“面试造火箭，工作拧螺...</description></item><item><title>Rust 看了流泪，AI 看了沉默：扒开 Go 泛型最让你抓狂的“残疾”类型推断</title><link>https://tonybai.com/2026/03/27/function-type-inference-should-work-in-all-assignment-contexts/</link><pubDate>Fri, 27 Mar 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/03/27/function-type-inference-should-work-in-all-assignment-contexts/</guid><description>本文永久链接 – https://tonybai.com/2026/03/27/function-type-inference-should-work-in-all-assignment-contexts 大家好，我是Tony Bai。 在这个大模型（AI）写代码如喝水一般简单的时代，你有没有遇到过一种极其憋屈的场景： 你让 Claude Code 或者 Codex 帮你写了一段 Go 语言代码，...</description></item><item><title>Go 语言之父亲自下场道歉：藏在 Spec 里的十年“笔误”，终于要修正了！</title><link>https://tonybai.com/2026/03/25/go-spec-contradiction-in-types-section/</link><pubDate>Wed, 25 Mar 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/03/25/go-spec-contradiction-in-types-section/</guid><description>本文永久链接 – https://tonybai.com/2026/03/25/go-spec-contradiction-in-types-section 大家好，我是Tony Bai。 在 Go 语言的世界里，type 是我们每天都在打交道的关键字。但如果我今天问你一个极其基础的问题： **Go 语言内置的 bool 类型，到底是不是一个“Defined Type（已定义类型）”？** 你可能...</description></item><item><title>别再像 2015 年那样写 Go 了：Modern Go 终极进化指南</title><link>https://tonybai.com/2026/03/02/modern-go-evolution-guide-1-0-to-1-26/</link><pubDate>Mon, 02 Mar 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/03/02/modern-go-evolution-guide-1-0-to-1-26/</guid><description>本文永久链接 – https://tonybai.com/2026/03/02/modern-go-evolution-guide-1-0-to-1-26 大家好，我是Tony Bai。 Go 语言在业界最著名的标签之一就是“向后兼容承诺（Go 1 Compatibility Promise）”。一份 10 年前写下的 Go 1.4 代码，在今天的 Go 1.26编译器下依然能完美编译并运行。 但...</description></item><item><title>Go 1.26 重磅更新：用 go fix 重塑代码现代化的艺术</title><link>https://tonybai.com/2026/02/19/using-go-fix-to-modernize-go-code/</link><pubDate>Thu, 19 Feb 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/02/19/using-go-fix-to-modernize-go-code/</guid><description>本文永久链接 – https://tonybai.com/2026/02/19/using-go-fix-to-modernize-go-code 大家好，我是Tony Bai。 2026年2月，Go 1.26 正式发布。除了语言层面的新特性（如 new(expr)）和运行时的性能提升（如 Green Tea GC）之外，工具链迎来了一次史诗级的升级：go fix 命令被彻底重写。 在过去，go ...</description></item><item><title>沉睡 8 年的提案被唤醒：Go 语言真的要引入“不可变类型”了吗？</title><link>https://tonybai.com/2026/02/09/go-immutable-types-8-year-dormant-proposal-awakened/</link><pubDate>Mon, 09 Feb 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/02/09/go-immutable-types-8-year-dormant-proposal-awakened/</guid><description>本文永久链接 – https://tonybai.com/2026/02/09/go-immutable-types-8-year-dormant-proposal-awakened 大家好，我是Tony Bai。 2026 年 2 月 4 日，在 Go 语言规范团队的最新一次“语言变更评审会议”纪要中，一个尘封已久的 Issue 赫然在列：**proposal: spec: immutable ...</description></item><item><title>“Go 2，请不要发生！”：如果 Go 变成了“缝合怪”，你还会爱它吗？</title><link>https://tonybai.com/2026/02/06/go-2-dont-become-a-frankenstein-monster/</link><pubDate>Fri, 06 Feb 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/02/06/go-2-dont-become-a-frankenstein-monster/</guid><description>本文永久链接 – https://tonybai.com/2026/02/06/go-2-dont-become-a-frankenstein-monster 大家好，我是Tony Bai。 &amp;gt; “Go 2, please don’t make it happen.” 近日，一张充满讽刺意味的老梗图在 r/golang 社区又炸开了锅。图片的上方，是我们熟悉的 Gopher 吉祥物——那只呆萌、简...</description></item><item><title>Go, Rust 还是 Zig？一场关于“简单”与“控制”的灵魂拷问</title><link>https://tonybai.com/2026/01/17/go-rust-zig-simplicity-vs-control/</link><pubDate>Sat, 17 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/17/go-rust-zig-simplicity-vs-control/</guid><description>Go, Rust 还是 Zig？一场关于“简单”与“控制”的灵魂拷问 - Tony Bai Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关于我 * 我的技术专栏...</description></item><item><title>为什么 Go 社区强调避免不必要的抽象？—— 借用海德格尔哲学寻找“正确”的答案</title><link>https://tonybai.com/2026/01/16/go-community-the-right-kind-of-abstraction/</link><pubDate>Fri, 16 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/16/go-community-the-right-kind-of-abstraction/</guid><description>本文永久链接 – https://tonybai.com/2026/01/16/go-community-the-right-kind-of-abstraction 大家好，我是Tony Bai。 **“Go 的哲学强调避免不必要的抽象。”** 这句话我们听过无数次。当你试图引入 ORM、泛型 Map/Reduce 、接口或者复杂的设计模式时，往往会收到这样的反馈。这句话本身没有错，但难点在于：*...</description></item><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>Brad Fitzpatrick 也等不及了！sync.Map 的泛型进化与 sync/v2 的诞生之路</title><link>https://tonybai.com/2025/12/01/proposal-sync-v2/</link><pubDate>Mon, 01 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/01/proposal-sync-v2/</guid><description>Brad Fitzpatrick 也等不及了！sync.Map 的泛型进化与 sync/v2 的诞生之路 - Tony Bai Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课...</description></item><item><title>告别懵圈：实战派 Gopher 的类型理论入门</title><link>https://tonybai.com/2025/10/30/type-theory-intro-for-gopher/</link><pubDate>Thu, 30 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/30/type-theory-intro-for-gopher/</guid><description>本文永久链接 – https://tonybai.com/2025/10/30/type-theory-intro-for-gopher 大家好，我是Tony Bai。 你是否曾有过这样的经历：在浏览一个关于 Go 泛型或接口设计的 GitHub issue 或技术提案时，评论区里的大佬们突然开始讨论 “Sum Type”、“Product Type”、“Parametric Polymorphi...</description></item><item><title>Go 技术沉思录：Java 26 年演进史给我们带来的启示</title><link>https://tonybai.com/2025/10/18/lessons-from-java-26-years-evolution/</link><pubDate>Sat, 18 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/18/lessons-from-java-26-years-evolution/</guid><description>本文永久链接 – https://tonybai.com/2025/10/18/lessons-from-java-26-years-evolution 大家好，我是Tony Bai。 历史不会简单重复，但总是惊人地相似。编程语言的演化，如同一部波澜壮阔的史诗，充满了智慧的闪光、艰难的抉择与深刻的教训。 上月，资深工程师 Neil Madden 发表了一篇引人入胜的文章《点评 26 年的 Java...</description></item><item><title>Go的简洁神话？转Go前你需要知道的5个“真相”</title><link>https://tonybai.com/2025/04/29/hard-truths-before-switching-to-go/</link><pubDate>Tue, 29 Apr 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/04/29/hard-truths-before-switching-to-go/</guid><description>Go的简洁神话？转Go前你需要知道的5个“真相” - Tony Bai =============== Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关于我 * ...</description></item><item><title>11个现代Go特性：用gopls/modernize让你的代码焕然一新</title><link>https://tonybai.com/2025/04/15/embrace-modern-go-style-with-gopls-modernize/</link><pubDate>Tue, 15 Apr 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/04/15/embrace-modern-go-style-with-gopls-modernize/</guid><description>本文永久链接 – https://tonybai.com/2025/04/15/embrace-modern-go-style-with-gopls-modernize 大家好，我是Tony Bai。 最近在思考Go语言的发展时，不禁让我想起了当年学习C++的经历。Bjarne Stroustrup在《C++程序设计语言（特别版）》中就专门强调了“现代 C++”（Modern C++）的编程风格，...</description></item><item><title>体验Gemini Deep Research：以Go语言未来演进方向分析为例</title><link>https://tonybai.com/2025/03/16/gemini-deep-research-experience/</link><pubDate>Sun, 16 Mar 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/03/16/gemini-deep-research-experience/</guid><description>本文永久链接 – https://tonybai.com/2025/03/16/gemini-deep-research-experience 基于大模型的AI已进入深度思考时代，以DeepSeek R1模型为代表的开源模型给主流AI厂商带来了巨大压力。其实早在2024年12月份，Google就在一篇名为“Try Deep Research and our new experimental mod...</description></item><item><title>Go语言演进的双保险：GOEXPERIMENT与GODEBUG</title><link>https://tonybai.com/2024/10/11/go-evolution-dual-insurance-goexperiment-godebug/</link><pubDate>Fri, 11 Oct 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/10/11/go-evolution-dual-insurance-goexperiment-godebug/</guid><description>本文永久链接 – https://tonybai.com/2024/10/11/go-evolution-dual-insurance-goexperiment-godebug Go语言自诞生以来就以其简洁、高效和强大的并发支持而闻名，Go团队承诺保持Go1向后兼容性，以确保用户的代码在未来的版本中继续正常运行。然而，保持语言的稳定性与不断创新(增加新特性)之间的平衡一直是Go团队面临的挑战。为了...</description></item><item><title>“类型名称”在Go语言规范中的演变</title><link>https://tonybai.com/2024/09/24/the-evolution-of-type-name-in-go-spec/</link><pubDate>Tue, 24 Sep 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/09/24/the-evolution-of-type-name-in-go-spec/</guid><description>“类型名称”在Go语言规范中的演变 | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章列表 “类型名称”在Go语言规范中的演...</description></item><item><title>Go unique包：突破字符串局限的通用值Interning技术实现</title><link>https://tonybai.com/2024/09/18/understand-go-unique-package-by-example/</link><pubDate>Wed, 18 Sep 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/09/18/understand-go-unique-package-by-example/</guid><description>本文永久链接 – https://tonybai.com/2024/09/18/understand-go-unique-package-by-example Go的1.23版本中引入了一个新的标准库包unique，为Go开发者带来了高效的值interning能力)。这种能力不仅适用于字符串类型值，还可应用于任何可比较(comparable)类型的值。 本文将简要探讨interning技术及其在G...</description></item><item><title>Go 1.18之后的语法新特性Quiz，你能做对几个？</title><link>https://tonybai.com/2024/08/27/a-new-syntax-quiz-after-go-1-18/</link><pubDate>Tue, 27 Aug 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/08/27/a-new-syntax-quiz-after-go-1-18/</guid><description>Go 1.18之后的语法新特性Quiz，你能做对几个？ | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章列表 Go 1.1...</description></item><item><title>Go 1.23中值得关注的几个变化</title><link>https://tonybai.com/2024/08/19/some-changes-in-go-1-23/</link><pubDate>Mon, 19 Aug 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/08/19/some-changes-in-go-1-23/</guid><description>本文永久链接 – https://tonybai.com/2024/08/19/some-changes-in-go-1-23 距离上一次Go 1.22版本发布又过去六个月了，我们如期迎来了Go 1.23版本的发布。 对于Go项目乃至整个Go社区而言，这个版本还有一点额外的意义，那就是这是Russ Cox作为Tech lead，领导Go团队发布的最后一个Go版本了。 8月2日，Russ Cox在g...</description></item><item><title>通过Go示例理解函数式编程思维</title><link>https://tonybai.com/2024/08/11/understand-functional-programming-in-go/</link><pubDate>Sun, 11 Aug 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/08/11/understand-functional-programming-in-go/</guid><description>本文永久链接 – https://tonybai.com/2024/08/11/understand-functional-programming-in-go &amp;gt; 一个孩子要尝试10次、20次才肯接受一种新的食物，我们接受一种新的范式，大概不会比这个简单。– 郭晓刚 《函数式编程思维》译者 函数式编程(Functional Programming, 简称fp)是一种编程范式，与命令式编程(Impe...</description></item><item><title>Go语言之父的反思：我们做对了什么，做错了什么</title><link>https://tonybai.com/2024/01/07/what-we-got-right-what-we-got-wrong/</link><pubDate>Sun, 07 Jan 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/01/07/what-we-got-right-what-we-got-wrong/</guid><description>本文永久链接 – https://tonybai.com/2024/01/07/what-we-got-right-what-we-got-wrong 在《2023年Go语言盘点：稳中求新，稳中求变》和《Go测试的20个实用建议》两篇文章中，我都提到过已经退居二线的Go语言之父Rob Pike在Go开源14周年的那天亲自在GopherCon Australia 2023上发表了“What We G...</description></item><item><title>Service Weaver：以单体形式编码，以微服务形式部署</title><link>https://tonybai.com/2023/10/09/service-weaver-coding-in-monolithic-deploy-in-microservices/</link><pubDate>Mon, 09 Oct 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/10/09/service-weaver-coding-in-monolithic-deploy-in-microservices/</guid><description>本文永久链接 – https://tonybai.com/2023/10/09/service-weaver-coding-in-monolithic-deploy-in-microservices 分布式应用的主流架构模式演化为**微服务架构**已经有些年头了。微服务、DevOps、持续交付和容器技术(k8s)是构成最初云原生概念的核心要素。它们相生相拌，共同演进，并推动了云计算**全面进入云原...</description></item><item><title>Go 1.21中值得关注的几个变化</title><link>https://tonybai.com/2023/08/20/some-changes-in-go-1-21/</link><pubDate>Sun, 20 Aug 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/08/20/some-changes-in-go-1-21/</guid><description>本文永久链接 – https://tonybai.com/2023/08/20/some-changes-in-go-1-21 美国时间2023年8月8日，Go团队在Go官博上正式发布了1.21版本！ 早在今年4月末，我就撰写了文章《Go 1.21新特性前瞻》，对Go 1.21可能引入的新特性、新优化和新标准库包做了粗略梳理。 在6月初举办的GopherChina 2023大会上，我又以“The ...</description></item><item><title>Go错误处理：错误链使用指南</title><link>https://tonybai.com/2023/05/14/a-guide-of-using-go-error-chain/</link><pubDate>Sun, 14 May 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/05/14/a-guide-of-using-go-error-chain/</guid><description>本文永久链接 – https://tonybai.com/2023/05/14/a-guide-of-using-go-error-chain 0\. Go错误处理简要回顾 -------------- Go是一种非常强调错误处理的编程语言。在Go中，错误被表示为实现了error接口的类型的值，error接口只有一个方法： type error interface { Error() string...</description></item><item><title>Go 1.21新特性前瞻</title><link>https://tonybai.com/2023/04/26/go-1-21-foresight/</link><pubDate>Wed, 26 Apr 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/04/26/go-1-21-foresight/</guid><description>本文永久链接 – https://tonybai.com/2023/04/26/go-1-21-foresight Go 1.21版本正在如火如荼地开发当中，按照Go核心团队的一年两次的发布节奏来算，Go 1.21版本预计将在2023年8月发布(Go 1.20版本是在2023年2月份发布的)。 本文将和大家一起看看Go 1.21都会带来哪些新特性。不过由于目前为时尚早，下面列出的有些变化最终不一定...</description></item><item><title>十分钟入门Go语言</title><link>https://tonybai.com/2023/02/23/learn-go-in-10-min/</link><pubDate>Thu, 23 Feb 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/02/23/learn-go-in-10-min/</guid><description>本文永久链接 – https://tonybai.com/2023/02/23/learn-go-in-10-min 本文旨在带大家快速入门Go语言，期望小伙伴们在花费十分钟左右通读全文后能对Go语言有一个初步的认知，为后续进一步深入学习Go奠定基础。 本文假设你完全没有接触过Go，你可能是一名精通其他编程语言的程序员，也可能是毫无编程经验、刚刚想转行为码农的热血青年。 编程简介 ---- 编程就...</description></item><item><title>Go 1.20中值得关注的几个变化</title><link>https://tonybai.com/2023/02/08/some-changes-in-go-1-20/</link><pubDate>Wed, 08 Feb 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/02/08/some-changes-in-go-1-20/</guid><description>本文永久链接 – https://tonybai.com/2023/02/08/some-changes-in-go-1-20 美国时间2023年2月1日，唯一尚未退休的Go语言之父Robert Griesemer代表Go核心开发团队在Go官博撰文正式发布了Go 1.20版本。就像Russ Cox在2022 GopherCon大会所说的那样：**Go2永不会到来，Go 1.x.y将无限延续**！ ...</description></item><item><title>2022年Go语言盘点：泛型落地，无趣很好，稳定为王</title><link>https://tonybai.com/2022/12/29/the-2022-review-of-go-programming-language/</link><pubDate>Thu, 29 Dec 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/12/29/the-2022-review-of-go-programming-language/</guid><description>本文永久链接 – https://tonybai.com/2022/12/29/the-2022-review-of-go-programming-language 早早就计划好在年前写一个Go语言年度盘点，就像2020年和2021年那样。但恰逢国内疫情管控放开，一波阳了之后身体十分容易疲劳，再加上工作上的事情挺多，这篇盘点也就迟迟没能下笔。 今年的盘点思路将围绕三个关键字来展开：**泛型、无趣(...</description></item><item><title>Go类型系统：有何与众不同</title><link>https://tonybai.com/2022/12/18/go-type-system/</link><pubDate>Sun, 18 Dec 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/12/18/go-type-system/</guid><description>本文永久链接 – https://tonybai.com/2022/12/18/go-type-system Go是一门强类型的静态编程语言。使用Go编程，我们的每一行代码几乎都离不开**类型**。因此，深入学习Go，我们首先要对Go的类型系统(type system)有一个全面和深入的认知。Go类型系统可以给予我们一个全局整体的视角，以帮助我们更好地学习和理解Go语言中那些具体的与类型相关的内容...</description></item><item><title>Go，13周年[译]</title><link>https://tonybai.com/2022/11/11/go-opensource-13-years/</link><pubDate>Fri, 11 Nov 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/11/11/go-opensource-13-years/</guid><description>本文永久链接 – https://tonybai.com/2022/11/11/go-opensource-13-years 在中华大地的老百姓抱着手机进行双十一购物节狂欢，忙着支付尾款和秒杀的时候，Go核心团队的Russ Cox代表Go语言项目团队在Go官博上发表了《Thirteen Years of Go》的博文，纪念Go语言开源13周年，并对2021年以来Go语言的演进进行了归纳总结，对Go...</description></item><item><title>Go 1.19中值得关注的几个变化</title><link>https://tonybai.com/2022/08/22/some-changes-in-go-1-19/</link><pubDate>Mon, 22 Aug 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/08/22/some-changes-in-go-1-19/</guid><description>本文永久链接 – https://tonybai.com/2022/08/22/some-changes-in-go-1-19 我们知道Go团队在2015年重新规定了团队发布版本的节奏，将Go大版本的发布频率确定为每年两次，发布窗口定为每年的2月与8月。而实现自举的Go 1.5版本是这一个节奏下发布的第一个版本。一般来说，Go团队都会在这两个窗口的中间位置发布版本，不过这几年也有意外，比如承载着泛...</description></item><item><title>Go 1.19新特性前瞻</title><link>https://tonybai.com/2022/06/12/go-1-19-foresight/</link><pubDate>Sun, 12 Jun 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/06/12/go-1-19-foresight/</guid><description>本文永久链接 – https://tonybai.com/2022/06/12/go-1-19-foresight 美国时间2022年5月7日，Go 1.19版本开发分支进入新特性冻结(freeze)阶段，即只能修Bug，不能再向Go 1.19版本中增加新特性了。由于上一个版本Go 1.18因引入泛型改动较大，推迟了一个月发布，这直接导致了Go 1.19版本的开发周期被缩短。 虽然开发周期少了近一...</description></item><item><title>评点2021-2022年上市的那些Go语言新书</title><link>https://tonybai.com/2022/06/01/reviewing-those-new-go-language-books-coming-out-in-2021-2022/</link><pubDate>Wed, 01 Jun 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/06/01/reviewing-those-new-go-language-books-coming-out-in-2021-2022/</guid><description>本文永久链接 – https://tonybai.com/2022/06/01/reviewing-those-new-go-language-books-coming-out-in-2021-2022 计算机科学与技术这个工业大类与传统工业类别相比还很“年轻”，并且由于历史原因，整个计算机科学与技术学科的奠基都是由欧美人完成的，因此但凡诞生一门新IT技术或新编程语言，我们首先参考的都是来自欧美的...</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><item><title>Go 1.18中值得关注的几个变化</title><link>https://tonybai.com/2022/04/20/some-changes-in-go-1-18/</link><pubDate>Wed, 20 Apr 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/04/20/some-changes-in-go-1-18/</guid><description>本文永久链接 – https://tonybai.com/2022/04/20/some-changes-in-go-1-18 &amp;gt; 从3月23日开始，我居家办公了20+天。这期间我本来是应该有时间写下这篇综述类文章的，但是封了两天后，抢菜、带娃的事情就开始困扰着我。我实在没有下笔写下这篇文章的心思。4月13日终于解封了，上班后的气象就是不一样，人也精神了很多，于是这篇文章也被提上了日程。希望新冠疫...</description></item><item><title>Go 1.18版本正式发布了</title><link>https://tonybai.com/2022/03/16/go-1-18-released/</link><pubDate>Wed, 16 Mar 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/03/16/go-1-18-released/</guid><description>本文永久链接 – https://tonybai.com/2022/03/16/go-1-18-released 美国时间2022年3月15日，Go核心团队官宣了Go 1.18版本正式版的发布！这是一个万众期待的版本，因为在这个版本中，Go核心团队做了Go语言开源以来的最大一次语法特性变更 – 增加了对泛型(generics)的支持！下面是对Go官博文章的全文翻译，供大家参考！ * * * 今天，...</description></item><item><title>切换到Go 1.18后的第一件事：将interface{}全部替换为any</title><link>https://tonybai.com/2021/12/18/replace-empty-interface-with-any-first-after-switching-to-go-1-18/</link><pubDate>Sat, 18 Dec 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/12/18/replace-empty-interface-with-any-first-after-switching-to-go-1-18/</guid><description>本文永久链接 – https://tonybai.com/2021/12/18/replace-empty-interface-with-any-first-after-switching-to-go-1-18 伴随着Go 1.18 beta1版本的发布，很多Gopher已经迫不及待地下载该版本并体验其中的新特性了！ Go 1.18 beta1到手后，**你想做的第一件事是什么呢**？ 说到这里，...</description></item><item><title>Go 1.18 Beta1版本发布，支持泛型[译]</title><link>https://tonybai.com/2021/12/15/go-1-18-beta1/</link><pubDate>Wed, 15 Dec 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/12/15/go-1-18-beta1/</guid><description>本文永久链接 – https://tonybai.com/2021/12/15/go-1-18-beta1 北京时间今天凌晨，美国时间12月14日，Go核心团队技术负责人Russ Cox在Go官博发表文章《Go 1.18 Beta 1 is available, with generics》，正式宣布Go 1.18的第一个预览版Go 1.18 beta1发布！Go团队这次少见的通过官博来发布一个b...</description></item><item><title>Go 1.18新特性前瞻：原生支持Fuzzing测试</title><link>https://tonybai.com/2021/12/01/first-class-fuzzing-in-go-1-18/</link><pubDate>Wed, 01 Dec 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/12/01/first-class-fuzzing-in-go-1-18/</guid><description>本文永久链接 – https://tonybai.com/2021/12/01/first-class-fuzzing-in-go-1-18 今年6月初，Go官博发表了一篇名为《Fuzzing is Beta Ready》的文章，文中称gotip版本已经原生支持Fuzzing并开始了公测。这意味着Fuzzing将以一等公民(first-class citizen)的身份正式加入到即将于2022年2...</description></item><item><title>Go，12周年</title><link>https://tonybai.com/2021/11/11/go-opensource-12-years/</link><pubDate>Thu, 11 Nov 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/11/11/go-opensource-12-years/</guid><description>本文永久链接 – https://tonybai.com/2021/11/11/go-opensource-12-years 2009年11月10日，Go语言正式对外发布并开源。如今，距那一历史时刻已经过去12年了。今早Go核心团队技术负责人Russ Cox在Go官博撰文庆祝Go开源12周年，他回顾了这一年来发布的Go 1.16与Go 1.17版本给Go与Go社区带来的变化，粗略总结了Go核心团队...</description></item><item><title>Ian Lance Taylor：Go泛型使用的一般准则</title><link>https://tonybai.com/2021/11/07/using-generics-in-go/</link><pubDate>Sun, 07 Nov 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/11/07/using-generics-in-go/</guid><description>本文永久链接 – https://tonybai.com/2021/11/07/using-generics-in-go 在近期Google Open Source Live的Go Day 2021环节，Go泛型的主要设计者Ian Lance Taylor做了Using Generics in Go的简短演讲(国内地址在这里)。这篇演讲的重点**不是即将于Go 1.18版本降临的Go泛型的语法细节...</description></item><item><title>Go 1.18对泛型的支持策略</title><link>https://tonybai.com/2021/10/28/expectations-for-generics-in-go-1-18/</link><pubDate>Thu, 28 Oct 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/10/28/expectations-for-generics-in-go-1-18/</guid><description>本文永久链接 – https://tonybai.com/2021/10/28/expectations-for-generics-in-go-1.18 2021年10月中旬，Go语言之父Rob Pike在github上的Go项目中发了一条issue：建议不在Go 1.18的标准库中使用泛型。 不得不说“姜还是老的辣”！Rob Pike的理由很简单，Go泛型是Go诞生以来最大的一次语言变化，Go ...</description></item><item><title>Go语言之父谈Go编程语言与环境</title><link>https://tonybai.com/2021/10/06/the-go-programming-language-and-environment/</link><pubDate>Wed, 06 Oct 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/10/06/the-go-programming-language-and-environment/</guid><description>本文永久链接 – https://tonybai.com/2021/10/06/the-go-programming-language-and-environment 2021年中旬，Go语言联合创始人Rob Pike应邀在线出席由UNSW Computing(悉尼新南威尔士大学计算机)组织主办的John Lions Distinguished Lectures，会上Rob Pike以Go之父身份...</description></item><item><title>Brooks、Wirth和Go[译]</title><link>https://tonybai.com/2021/08/25/brooks-wirth-and-go/</link><pubDate>Wed, 25 Aug 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/08/25/brooks-wirth-and-go/</guid><description>本文永久链接 – https://tonybai.com/2021/08/25/brooks-wirth-and-go 本文翻译自瑞典程序员Fredrik Holmqvist的博客文章《Brooks, Wirth and Go》。 现在是1975年。 程序员们带着FORTRAN代码回来了，不过使用的是穿孔卡片的形式。 图：记录代码的穿孔卡片(图片来自punchcardreader.com，译者加)...</description></item><item><title>Go 1.17新特性详解：支持将切片转换为数组指针</title><link>https://tonybai.com/2021/08/18/go-language-specs-changes-in-go-1-17/</link><pubDate>Wed, 18 Aug 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/08/18/go-language-specs-changes-in-go-1-17/</guid><description>本文永久链接 – https://tonybai.com/2021/08/18/go-language-specs-changes-in-go-1-17 Go属于那种极简的语言，从诞生到现在语言自身特性变化很小，不会像其他主流语言那样走“你有的我也要有”的特性融合路线。因此新语言特性对于Gopher来说属于“稀缺品”，属于“供不应求”那类事物^\_^。这也直接导致了每次Go新版本发布，我们都要首先...</description></item><item><title>Go 1.17中值得关注的几个变化</title><link>https://tonybai.com/2021/08/17/some-changes-in-go-1-17/</link><pubDate>Tue, 17 Aug 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/08/17/some-changes-in-go-1-17/</guid><description>本文永久链接 – https://tonybai.com/2021/08/17/some-changes-in-go-1-17 Go核心开发团队在去年GopherCon大会上给Go泛型的定调是在2022年2月份的Go 1.18版本中发布，那可是自Go诞生以来语法规范变动最大的一次，这让包括笔者在内的全世界的Gopher们都满怀期待。 不过别忘了，在Go 1.18这个“网红版本”发布前，还有一个“实...</description></item><item><title>Go 1.16中值得关注的几个变化</title><link>https://tonybai.com/2021/02/25/some-changes-in-go-1-16/</link><pubDate>Thu, 25 Feb 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/02/25/some-changes-in-go-1-16/</guid><description>辛丑牛年初七开工大吉的日子(2021.2.18)，Go核心开发团队为中国Gopher们献上了大礼 – Go 1.16版本正式发布了！国内Gopher可以在Go中国官网上下载到Go 1.16在各个平台的安装包： 2020年双12，Go 1.16进入freeze状态，即不再接受新feature，仅fix bug、编写文档和接受安全更新等，那时我曾写过一篇名为《Go 1.16新功能特性不完全前瞻》的文章...</description></item><item><title>Hugo作者、Go核心开发团队成员谈诞生13年的Go语言：生态系统、演化与未来[译]</title><link>https://tonybai.com/2021/01/02/go-language-13-years/</link><pubDate>Sat, 02 Jan 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/01/02/go-language-13-years/</guid><description>本文翻译自《Go Language at 13 Years: Ecosystem, Evolution, and Future in Conversation with Steve Francia》。 &amp;gt; 译注：Go开源于2009年，如果从那时算起，Go才11岁；但在Go核心开发团队眼中，Go的真正诞生年份是2007年，至今13个年头了。关于Go的演化简史可以参见我的专栏文章：《Go语言的前生今世...</description></item><item><title>一文告诉你如何抢先体验Go泛型</title><link>https://tonybai.com/2020/11/28/httpstonybai-com20201128how-to-experience-go-generics-first/</link><pubDate>Sat, 28 Nov 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/11/28/httpstonybai-com20201128how-to-experience-go-generics-first/</guid><description>本文首发于我主持的“Gopher部落”知识星球，欢迎大家加入星球，一起学习Go语言！年底前8.8折优惠，不要错过哦！ 2020年11月22日，Go核心开发团队技术负责人Russ Cox在golang-dev论坛上确认了Go泛型将在Go 1.18落地(2022.2)： 这对于那些迫切期盼go加入泛型的gopher来说无疑是一个重大利好消息！不过，泛型是把双刃剑！泛型的加入势必会让Go语言的复杂性大幅...</description></item><item><title>Go，11周年</title><link>https://tonybai.com/2020/11/11/go-opensource-11-years/</link><pubDate>Wed, 11 Nov 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/11/11/go-opensource-11-years/</guid><description>本文翻译自Go官方博客文章《Eleven Years of Go》，原作者：Russ Cox。 今天，我们一起庆祝Go语言正式开业发布11周年。去年的“Go turning 10”周年庆典聚会似乎已成为久远的回忆。这是艰难的一年，但我们一直保持了Go开发的步伐，并积累了很多亮点。 在去年11月，我们在庆祝Go 10周年后不久就发布和上线了go.dev和pkg.go.dev站点。 今年2月，Go 1...</description></item><item><title>系统学习Go语言，有这几本书就够了！</title><link>https://tonybai.com/2020/11/04/the-recommend-books-list-for-learning-go/</link><pubDate>Wed, 04 Nov 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/11/04/the-recommend-books-list-for-learning-go/</guid><description>1\. Go语言的发展现状 如果从2007年9月20日那个下午三个“程序员大佬”在谷歌总部的一间办公室里进行的一次有关设计一门新编程语言的讨论算起，那么Go语言已经度过了自己的13个年头了。 Robert Griesemer、Rob Pike和Ken Thompson 如果从2009年11月10日Go语言正式开源发布算起，Go语言也即将迎来自己的第11个生日。 2020年，Go联合创始人Rob P...</description></item><item><title>Go泛型真的要来了！最早在Go 1.17版本支持</title><link>https://tonybai.com/2020/06/18/the-go-generics-is-coming-and-supported-in-go-1-17-at-the-earliest/</link><pubDate>Thu, 18 Jun 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/06/18/the-go-generics-is-coming-and-supported-in-go-1-17-at-the-earliest/</guid><description>Go官博今晨发表了Go核心团队两位大神Ian Lance Taylor和Go语言之父之一的Robert Griesemer撰写的文章“The Next Step for Generics”，该文介绍了Go泛型(Go Generics)的最新进展和未来计划。 2019年中旬，在Go 1.13版本发布前夕的GopherCon 2019大会上，Ian Lance Taylor代表Go核心团队做了有关Go...</description></item><item><title>Go语言联合作者Rob Pike专访：Go确实已成为云基础架构的语言</title><link>https://tonybai.com/2020/05/01/rob-pike-interview-go-become-the-language-of-cloud-infrastructure/</link><pubDate>Fri, 01 May 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/05/01/rob-pike-interview-go-become-the-language-of-cloud-infrastructure/</guid><description>&amp;gt; 尽管看到Docker，Kubernetes和用Go编写的云计算的许多其他组件令人欣喜和重要，但也许并不奇怪。Go确实已经成为云基础架构的语言。- Rob Pike，Go编程语言的联合作者 本文翻译自《Rob Pike interview: “Go has indeed become the language of cloud infrastructure”》。 简介 -- 我们与Go编程语言之...</description></item><item><title>Go2 Error Inspection前瞻</title><link>https://tonybai.com/2019/01/27/perspective-study-on-go2-error-inspection/</link><pubDate>Sun, 27 Jan 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/01/27/perspective-study-on-go2-error-inspection/</guid><description>这几年关于Go语言未来演化的讨论成为了Gopher世界的热点，Go team官方对于Go语言的演化(以Go2为标签)也是十分上心，但吸取了其他语言，比如：Python3割裂社区的、不兼容演化的教训，Go team最终选择了一条尽可能地兼容Go1、稳健、平滑的演化之路，并逐渐开始落地。Go 1.11的Go modules是Go team开启**Go2**演化进程的标志性事件。随着“Go 2 Draf...</description></item><item><title>Go 1.11中值得关注的几个变化</title><link>https://tonybai.com/2018/11/19/some-changes-in-go-1-11/</link><pubDate>Mon, 19 Nov 2018 00:00:00 +0800</pubDate><guid>https://tonybai.com/2018/11/19/some-changes-in-go-1-11/</guid><description>转眼间又近年底，距8月25日Go 1.11版本正式发布已过去快三个月了。由于种种原因，Go语言发布变化系列的Go 1.11版本没能及时放出。近期网课发布上线后，个人时间压力稍缓和。又恰看到近期Go 1.12 release note的initial version已经加入到master，于是这篇文章便上升到个人Todo list的Top3的位置，我也尽一切可能的碎片时间收集素材，撰写文章内容。这个...</description></item><item><title>Go，9周年</title><link>https://tonybai.com/2018/11/12/go-opensource-9-years/</link><pubDate>Mon, 12 Nov 2018 00:00:00 +0800</pubDate><guid>https://tonybai.com/2018/11/12/go-opensource-9-years/</guid><description>本文翻译自Go官方博客：《Nine years of Go》。 介绍 今天是我们的Go语言初始版本开源的第九个周年纪念日。在每个周年纪念日上，我们都希望花些时间思考过去一年发生的事情。过去12个月对Go语言和Go社区来说是突破性的一年。 对Go的爱和接纳 感谢你们所有人，2018年对Go来说是美好的一年！在多个行业调查中，Gopher们表达了他们使用Go的快乐程度，并且许多非Go开发者也表示了他们...</description></item><item><title>初窥Go module</title><link>https://tonybai.com/2018/07/15/hello-go-module/</link><pubDate>Sun, 15 Jul 2018 00:00:00 +0800</pubDate><guid>https://tonybai.com/2018/07/15/hello-go-module/</guid><description>自2007年“三巨头（Robert Griesemer, Rob Pike, Ken Thompson）”提出设计和实现Go语言以来，Go语言已经发展和演化了十余年了。这十余年来，Go取得了巨大的成就，先后在2009年和2016年当选TIOBE年度最佳编程语言，并在全世界范围内拥有数量庞大的拥趸。不过和其他主流编程语言一样，Go语言也不是完美的，不能满足所有开发者的“口味”。这些年来Go在“包依赖...</description></item><item><title>写Go代码时遇到的那些问题[第3期]</title><link>https://tonybai.com/2018/04/06/the-problems-i-encountered-when-writing-go-code-issue-3rd/</link><pubDate>Fri, 06 Apr 2018 00:00:00 +0800</pubDate><guid>https://tonybai.com/2018/04/06/the-problems-i-encountered-when-writing-go-code-issue-3rd/</guid><description>我有一个习惯，那就是随时记录下编程过程中遇到的问题（包括问题现场、问题起因以及对问题的分析），并喜欢阶段性的对一段时间内的**编码过程的得与失**进行回顾和总结。内容可以包括：对编程语法的新认知、遇坑填坑的经历、一些让自己豁然开朗的小tip/小实践等。记录和总结的多了，感觉有价值的，就成文发在博客上的；一些小的点，或是还没有想清楚的事情，或思路没法结构化统一的，就放在资料库里备用。“写Go代码时遇...</description></item><item><title>源创会开源访谈：十年成长，Go语言的演化之路</title><link>https://tonybai.com/2017/10/24/go-evolution-for-ten-years-an-interview-by-osc/</link><pubDate>Tue, 24 Oct 2017 00:00:00 +0800</pubDate><guid>https://tonybai.com/2017/10/24/go-evolution-for-ten-years-an-interview-by-osc/</guid><description>在参加源创会沈阳站分享之前，接受了开源中国社区编辑王练的文字专访，以下是我针对专访稿的内容。 同时该专访稿首发于开源中国开源访谈栏目，大家可以点击这里看到首发原稿。 1、首先请介绍一下自己 大家好！我叫白明（Tony Bai），目前是东软云科技的一名架构师，专职于服务端开发，日常工作主要使用Go语言。我算是国内较早接触Go语言的程序员兼Advocater了，平时在我的博客、微博和微信公众号”iam...</description></item></channel></rss>