<?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>Const on Tony Bai</title><link>https://tonybai.com/tags/const/</link><description>Recent content in Const on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Mon, 09 Feb 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/const/index.xml" rel="self" type="application/rss+xml"/><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 的 iota：设计缺陷还是“黑魔法”？—— 从一条“咆哮”推文谈起</title><link>https://tonybai.com/2025/10/25/go-iota-flaw-or-magic/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/25/go-iota-flaw-or-magic/</guid><description>本文永久链接 – https://tonybai.com/2025/10/25/go-iota-flaw-or-magic 大家好，我是Tony Bai。 “我一直在 DUNK Go，因为我觉得它是一门糟糕的语言。但我从未意识到，它比无底的绝望深渊还要深。这TMD是啥？” 近日，一条关于 Go 语言 iota 的“咆哮”推文在开发者社区引发了热议。推文作者 Dmitrii Kovanikov 贴出...</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>Go 1.22引入的包级变量初始化次序问题</title><link>https://tonybai.com/2024/03/29/the-issue-in-pkg-level-var-init-order-in-go-1-22/</link><pubDate>Fri, 29 Mar 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/03/29/the-issue-in-pkg-level-var-init-order-in-go-1-22/</guid><description>本文永久链接 – https://tonybai.com/2024/03/29/the-issue-in-pkg-level-var-init-order-in-go-1-22 细心的朋友可能已经注意到，从春节后，我的博客就“停更”了！实际上，这一情况部分是因为工作上的事务繁忙，另一部分则是因为我将工作之外的闲暇时间更多地投入到一本即将于今年中下旬出版的书的撰写了：在之前的积累基础上，我花了两个多...</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类型系统：有何与众不同</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>使用反射操作channel</title><link>https://tonybai.com/2022/11/15/using-reflect-to-manipulate-channels/</link><pubDate>Tue, 15 Nov 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/11/15/using-reflect-to-manipulate-channels/</guid><description>本文永久链接 – https://tonybai.com/2022/11/15/using-reflect-to-manipulate-channels * * * 今年教师节极客时间送给讲师4999 SVIP卡，一直没顾过来用，上周激活后在极客时间的众多精品课和专栏中徜徉，收获颇丰。尤其是在拜读鸟窝老师的《Go并发编程实战课》 后，get到一个以前从未用过的“技能点”：**使用reflect操作...</description></item><item><title>为什么这个T类型实例无法调用*T类型的方法</title><link>https://tonybai.com/2022/02/27/go-addressable/</link><pubDate>Sun, 27 Feb 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/02/27/go-addressable/</guid><description>本文永久链接 – https://tonybai.com/2022/02/27/go-addressable 近期在“Go语言第一课”专栏后台看到一位学员的一则留言，如下图： 由于有课程上下文，所以我这里将问题的上下文重新描述一下。 在专栏的第25讲，我们学习了Go语言提供的一个“语法糖”，比如下面这个例子： ``` type T struct { a int } func (t T) M1() ...</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>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>C++咬文嚼字－'Hijack const'</title><link>https://tonybai.com/2007/03/09/cpp-weigh-every-word-series-hijack-const/</link><pubDate>Fri, 09 Mar 2007 00:00:00 +0800</pubDate><guid>https://tonybai.com/2007/03/09/cpp-weigh-every-word-series-hijack-const/</guid><description>晚上无意翻看Bjarne Stroustrup的&amp;#39;The C++ Programming Language Special Edition&amp;#39;(英文版)第94页，章节5.4 Constants一节，看到这么一句原文&amp;#39;C++ offers the concept of a user-defined constant, a const, to express the notion that a valu...</description></item></channel></rss>