<?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>Gofmt on Tony Bai</title><link>https://tonybai.com/tags/gofmt/</link><description>Recent content in Gofmt on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Mon, 06 Apr 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/gofmt/index.xml" rel="self" type="application/rss+xml"/><item><title>AI 编程时代，我挖出了一本 1999 年的“删库跑路”指南</title><link>https://tonybai.com/2026/04/06/how-to-write-unmaintainable-code/</link><pubDate>Mon, 06 Apr 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/04/06/how-to-write-unmaintainable-code/</guid><description>本文永久链接 – https://tonybai.com/2026/04/06/how-to-write-unmaintainable-code 大家好，我是Tony Bai。 在这个由 Claude、GPT、Gemini等大模型定义的 2026 年，我们似乎已经习惯了 AI 那种近乎“洁癖”的编码风格：优雅的接口设计、滴水不漏的错误处理、以及永远对齐的工整格式。 AI 正在用它那冰冷的、毫无感情...</description></item><item><title>OpenAI 创始人盛赞 Rust，却遭开发者反驳：Go 才是大模型眼里的“香饽饽”！</title><link>https://tonybai.com/2026/03/23/go-is-the-best-programming-language-for-llm/</link><pubDate>Mon, 23 Mar 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/03/23/go-is-the-best-programming-language-for-llm/</guid><description>本文永久链接 – https://tonybai.com/2026/03/23/go-is-the-best-programming-language-for-llm 大家好，我是Tony Bai。 在这个大模型重塑编程范式的当下，如果你想开发一个自主运行的智能体（Agent），或者想让大模型（LLM）帮你生成上万行的核心业务代码，你会选择哪门编程语言？ 如果你去问 OpenAI 的总裁兼联合创始...</description></item><item><title>代码简单，人也简单？揭秘 Go 社区的“反内卷”文化</title><link>https://tonybai.com/2025/12/31/why-go-community-so-active-and-friendly/</link><pubDate>Wed, 31 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/31/why-go-community-so-active-and-friendly/</guid><description>代码简单，人也简单？揭秘 Go 社区的“反内卷”文化 - Tony Bai Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关于我 * 我的技术专栏 * 文章列表 ...</description></item><item><title>像 Go 创始人一样思考：用五大思维原理重学 Go 语言</title><link>https://tonybai.com/2025/12/26/think-like-go-founders-relearn-go-five-principles/</link><pubDate>Fri, 26 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/26/think-like-go-founders-relearn-go-five-principles/</guid><description>本文永久链接 – https://tonybai.com/2025/12/26/think-like-go-founders-relearn-go-five-principles 大家好，我是Tony Bai。 学习一门新的编程语言时，我们常常陷入“是什么”的迷雾：goroutine 是什么？channel 是什么？interface 是什么？我们记忆语法，模仿示例，却很少追问那个更根本的问题——...</description></item><item><title>Go 的 AI 时代宣言：我们如何用“老”原则，解决“新”问题？</title><link>https://tonybai.com/2025/12/25/go-next-frontier-gophercon-2025/</link><pubDate>Thu, 25 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/25/go-next-frontier-gophercon-2025/</guid><description>本文永久链接 – https://tonybai.com/2025/12/25/go-next-frontier-gophercon-2025 大家好，我是Tony Bai。 “AI 正在重塑软件工程，但它并没有改变软件工程的本质。” 在 GopherCon 2025 上，Go 语言产品负责人 Cameron Balahan 发表了一场题为《Go 的下一个前沿领域》的主题演讲，重点关注了AI 时代...</description></item><item><title>逃离 Java 的“自行车棚”：Go 语言真的是那片“净土”吗？</title><link>https://tonybai.com/2025/12/18/escaping-java-bicycle-shed-is-go-the-pure-land/</link><pubDate>Thu, 18 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/18/escaping-java-bicycle-shed-is-go-the-pure-land/</guid><description>本文永久链接 – https://tonybai.com/2025/12/18/escaping-java-bicycle-shed-is-go-the-pure-land 大家好，我是Tony Bai。 “如果每次我看到‘为什么不这么写？’这种针对完美代码的 PR 评论都能得到一分钱，我现在已经退休了。” 近日，一位在 r/golang 社区发帖的开发者发出了这样的咆哮。他受够了 Java 生态...</description></item><item><title>Go 的 16 年：一门为持久而生的编程语言</title><link>https://tonybai.com/2025/11/12/16-years-of-go-a-programming-language-built-to-last/</link><pubDate>Wed, 12 Nov 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/11/12/16-years-of-go-a-programming-language-built-to-last/</guid><description>本文永久链接 – https://tonybai.com/2025/11/12/16-years-of-go-a-programming-language-built-to-last 大家好，我是Tony Bai。 每年的十一月，对于全球的 Gopher 而言，都是一个值得纪念的特殊时刻。今年，我们迎来了 Go 语言公开发布的第 16 个年头。 在众多的庆祝文章中，来自 Go 社区的知名组织 Ar...</description></item><item><title>Go 比 Python 更懂“Python 之禅”？</title><link>https://tonybai.com/2025/07/19/go-understand-the-zen-of-python-better-than-python/</link><pubDate>Sat, 19 Jul 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/07/19/go-understand-the-zen-of-python-better-than-python/</guid><description>本文永久链接 – https://tonybai.com/2025/07/19/go-understand-the-zen-of-python-better-than-python 大家好，我是Tony Bai。 最近，在国外的 Go 语言社区（Reddit r/golang）上，一个帖子引发了热烈的讨论。标题颇具“引战”意味：“Go似乎比Python更好地实现了Python之禅”。 这听起来像个...</description></item><item><title>代码之外的必修课：顶级技术文档风格指南如何提升你的工程效率</title><link>https://tonybai.com/2025/07/14/writing-style-guide/</link><pubDate>Mon, 14 Jul 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/07/14/writing-style-guide/</guid><description>本文永久链接 – https://tonybai.com/2025/07/14/writing-style-guide 大家好，我是Tony Bai。 作为一名开发者、架构师或运维专家，我们大部分时间都在与代码、系统和架构打交道。然而，我们同样在持续不断地进行另一种形式的“编码”——**沟通编码**。无论是撰写一个清晰的 README.md，提交一份详尽的 Pull Request 描述，编写项目...</description></item><item><title>爽就完了！Go语言的“简单之美”为何让开发者直呼过瘾？</title><link>https://tonybai.com/2025/06/12/grog-brain-heaven/</link><pubDate>Thu, 12 Jun 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/06/12/grog-brain-heaven/</guid><description>爽就完了！Go语言的“简单之美”为何让开发者直呼过瘾？ - 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/2025/05/31/six-smells-in-go/</link><pubDate>Sat, 31 May 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/05/31/six-smells-in-go/</guid><description>本文永久链接 – https://tonybai.com/2025/05/31/six-smells-in-go 大家好，我是Tony Bai。 在日常的代码审查 (Code Review) 和线上问题复盘中，我经常会遇到一些看似不起眼，却可能埋下巨大隐患的 Go 代码问题。这些“编码坏味道”轻则导致逻辑混乱、性能下降，重则引发数据不一致、系统崩溃，甚至让团队成员在深夜被告警声惊醒，苦不堪言。 今...</description></item><item><title>当Gopher拥有了“Go语言女友”：一张图带你读懂Go的那些“可爱”特性</title><link>https://tonybai.com/2025/05/30/gopher-girlfriend/</link><pubDate>Fri, 30 May 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/05/30/gopher-girlfriend/</guid><description>当Gopher拥有了“Go语言女友”：一张图带你读懂Go的那些“可爱”特性 - Tony Bai =============== Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶...</description></item><item><title>认知负荷对编程语言选择和学习的影响</title><link>https://tonybai.com/2024/10/24/cognitive-load-impact-on-programming-language-choice-and-study/</link><pubDate>Thu, 24 Oct 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/10/24/cognitive-load-impact-on-programming-language-choice-and-study/</guid><description>认知负荷对编程语言选择和学习的影响 | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章列表 认知负荷对编程语言选择和学习的影...</description></item><item><title>与Thorsten Ball的共鸣：Go作为教学语言在技术写作中的优越性</title><link>https://tonybai.com/2024/10/09/resonating-with-thorsten-ball-on-go-in-technical-writing/</link><pubDate>Wed, 09 Oct 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/10/09/resonating-with-thorsten-ball-on-go-in-technical-writing/</guid><description>与Thorsten Ball的共鸣：Go作为教学语言在技术写作中的优越性 | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章...</description></item><item><title>2024年的Rust与Go[译]</title><link>https://tonybai.com/2024/01/24/rust-vs-go-in-2024/</link><pubDate>Wed, 24 Jan 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/01/24/rust-vs-go-in-2024/</guid><description>本文永久链接 – https://tonybai.com/2024/01/24/rust-vs-go-in-2024 本文译自《Rust vs Go in 2024》。 * * * 我可以说些什么而不让大家生气吗？ Rust和Go哪个更好？你应该为下一个项目选择哪种语言，为什么？两者在性能、简单性、安全性、功能特性、规模化(scale)和并发性等方面如何比较？它们有什么共同点，又有什么根本区别？让...</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>Go未来演进：基于共同目标和数据驱动的决策</title><link>https://tonybai.com/2023/12/10/go-changes/</link><pubDate>Sun, 10 Dec 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/12/10/go-changes/</guid><description>本文永久链接 – https://tonybai.com/2023/12/10/go-changes 自从Go语言之父Rob Pike从Google退休并隐居澳洲后，Russ Cox便成为了Go语言团队的“带头大哥”，虽然其资历还无法与依旧奋战在一线的另外一位Go语言之父Robert Griesemer相比。如今，Russ Cox对Go语言未来的演化发展是很有“发言权”的，Go module的引入...</description></item><item><title>聊聊godoc、go doc与pkgsite</title><link>https://tonybai.com/2023/03/20/godoc-vs-go-doc-vs-pkgsite/</link><pubDate>Mon, 20 Mar 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/03/20/godoc-vs-go-doc-vs-pkgsite/</guid><description>本文永久链接 – https://tonybai.com/2023/03/20/godoc-vs-go-doc-vs-pkgsite 就像上一篇文章聊到的Go内置单元测试框架一样，既重视语言特性，又不忘对Go软件项目提供整体环境特性的Go在诞生伊始就定义了如何在源码中通过注释编写代码文档的格式，并提供了基于代码注释实时生成Go文档并支持文档查看的工具。 而一些早期的语言，比如C、C++等则需要使用...</description></item><item><title>2023年的Rust与Go[译]</title><link>https://tonybai.com/2023/02/22/rust-vs-go-in-2023/</link><pubDate>Wed, 22 Feb 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/02/22/rust-vs-go-in-2023/</guid><description>本文永久链接 – https://tonybai.com/2023/02/22/rust-vs-go-in-2023 本文译自《Rust vs Go in 2023》。 &amp;gt; 注：从2022年下半年开始，我们研发团队的产品研发不再局限于云端，车端也是将来的一个重要方向。于是我除了继续对Go语言保持常规的高度关注之外，也逐步开始留意Rust语言的发展。 * * * Rust和Go哪个更好？Go还是Ru...</description></item><item><title>GoCN社区Go读书会第二期：《Go语言精进之路》</title><link>https://tonybai.com/2022/07/07/gocn-community-go-book-club-issue2-go-programming-from-beginner-to-master/</link><pubDate>Thu, 07 Jul 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/07/07/gocn-community-go-book-club-issue2-go-programming-from-beginner-to-master/</guid><description>本文永久链接 – https://tonybai.com/2022/07/07/gocn-community-go-book-club-issue2-go-programming-from-beginner-to-master 本文是2022年6月26日我在**GoCN社区的Go读书会第二期《Go语言精进之路》直播的文字稿**。本文对直播的内容做了重新整理与修订，供喜欢阅读文字的朋友们在收看直播后...</description></item><item><title>Go程序员拥抱C语言简明指南</title><link>https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher/</link><pubDate>Mon, 16 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher/</guid><description>本文永久链接 – https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher 本文是为于航老师的极客时间专栏《深入C语言和程序运行原理》写的加餐文章《Tony Bai：Go程序员拥抱C语言简明指南》，这里分享给大家，尤其是那些想学习C语言的Gopher们。 * * * 你好，我是Tony Bai。 也许...</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语言“十诫”[译]</title><link>https://tonybai.com/2021/04/09/ten-commandments-of-go/</link><pubDate>Fri, 09 Apr 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/04/09/ten-commandments-of-go/</guid><description>本文永久链接 – https://tonybai.com/2021/04/09/ten-commandments-of-go 本文翻译自John Arundel的《Ten commandments of Go》。全文如下： 作为一名全职的Go语言作家和老师，我花了很多时间和学生们一起，帮助他们写出更清晰、更好、更有用的Go程序。我发现，我给他们的建议可以归纳总结为一套通用原则，在这里我将这些原则分...</description></item><item><title>Go语言的“黑暗角落”：盘点学习Go语言时遇到的那些陷阱[译]（第二部分）</title><link>https://tonybai.com/2021/03/29/darker-corners-of-go-part2/</link><pubDate>Mon, 29 Mar 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/03/29/darker-corners-of-go-part2/</guid><description>本文翻译自Rytis Bieliunas的文章《Darker Corners of Go》。 第一部分参见[《Go语言的“黑暗角落”：盘点学习Go语言时遇到的那些陷阱\[译\]（第一部分）》](https://tonybai.com/2021/03/29/darker-corners-of-go-part1) 7\. 字符串和字节数组 ------------ 1) Go中的字符串 Go字符串的内...</description></item><item><title>Go语言的“黑暗角落”：盘点学习Go语言时遇到的那些陷阱[译]（第一部分）</title><link>https://tonybai.com/2021/03/29/darker-corners-of-go-part1/</link><pubDate>Mon, 29 Mar 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/03/29/darker-corners-of-go-part1/</guid><description>本文翻译自Rytis Bieliunas的文章《Darker Corners of Go》。 &amp;gt; 译注：若干年前，Kyle Quest曾发过一篇名为“50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs”的文章，仿效著名的《C Traps and Pitfalls》编写了50条Go语言的陷阱与缺陷，一时在G...</description></item><item><title>Rust vs. Go：为什么强强联合会更好</title><link>https://tonybai.com/2021/03/15/rust-vs-go-why-they-are-better-together/</link><pubDate>Mon, 15 Mar 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/03/15/rust-vs-go-why-they-are-better-together/</guid><description>本文翻译自乔纳森·特纳（Jonathan Turner）和史蒂夫·弗朗西亚（Steve Francia）的文章《Rust vs. Go: Why They’re Better Together》。 &amp;gt; 史蒂夫·弗朗西亚（Steve Francia）：在过去的25年里，Steve Francia建立了一些最具创新性和成功的技术和公司，这些技术和公司已经成为云计算的基础，被全世界的企业和开发者所接受。...</description></item><item><title>Uber Go语言编码规范</title><link>https://tonybai.com/2019/10/12/uber-go-style-guide/</link><pubDate>Sat, 12 Oct 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/10/12/uber-go-style-guide/</guid><description>Uber是世界领先的生活出行服务提供商，也是Go语言的早期adopter，根据Uber工程博客的内容，大致可以判断出Go语言在Uber内部扮演了十分重要的角色。Uber内部的Go语言工程实践也是硕果累累，有大量Go实现的内部工具被Uber开源到github上，诸如被Gopher圈熟知的zap、jaeger等。2018年年末Uber将内部的Go风格规范开源到github，经过一年的积累和更新，该规范...</description></item><item><title>Go正走在成为下一个企业级编程语言的轨道上</title><link>https://tonybai.com/2019/05/03/go-is-on-a-trajectory-to-become-the-next-enterprise-programming-language/</link><pubDate>Fri, 03 May 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/05/03/go-is-on-a-trajectory-to-become-the-next-enterprise-programming-language/</guid><description>发展演化了十年的Go语言已经被证明了是云计算时代的首选编程语言，但Go的用武之地显然不局限于此。Kevin Goslar近期在Hacker Noon发表了一篇名为：《Go is on a Trajectory to Become the Next Enterprise Programming Language》的文章，阐述了Go可能成为下一个企业编程语言的理由，这里是那篇文章的中文译文，分享给大家...</description></item></channel></rss>