<?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>Go1.20 on Tony Bai</title><link>https://tonybai.com/tags/go1.20/</link><description>Recent content in Go1.20 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Fri, 20 Jun 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/go1.20/index.xml" rel="self" type="application/rss+xml"/><item><title>Go errors.Join：是“天赐之物”还是“潘多拉魔盒”？——深入错误聚合的适用场景与最佳实践</title><link>https://tonybai.com/2025/06/20/about-errors-join/</link><pubDate>Fri, 20 Jun 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/06/20/about-errors-join/</guid><description>本文永久链接 – https://tonybai.com/2025/06/20/about-errors-join 大家好，我是Tony Bai。 错误处理，无疑是软件开发中永恒的核心议题之一。Go 语言以其独特的、显式的错误处理机制（即 error 作为普通值返回）而著称，这种设计强调了对错误的关注和及时处理。自 Go 1.13 引入错误包装 (wrapping) 机制以来，Go 的错误处理能力...</description></item><item><title>2023年Go语言盘点：稳中求新，稳中求变</title><link>https://tonybai.com/2023/12/31/the-2023-review-of-go-programming-language/</link><pubDate>Sun, 31 Dec 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/12/31/the-2023-review-of-go-programming-language/</guid><description>本文永久链接 – https://tonybai.com/2023/12/31/the-2023-review-of-go-programming-language 时光荏苒，转眼间已经是2023年的最后一天了。《2022年Go语言盘点：泛型落地，无趣很好，稳定为王》仿佛就写在昨天。 回首这一年，全球彻底从新冠大流行中得以复苏，Go语言也不例外，最直观的表现就是**全球各地的GopherCon技术...</description></item><item><title>Go，14周年[译]</title><link>https://tonybai.com/2023/11/11/go-opensource-14-years/</link><pubDate>Sat, 11 Nov 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/11/11/go-opensource-14-years/</guid><description>本文永久链接 – https://tonybai.com/2023/11/11/go-opensource-14-years 国内的双十一购物狂欢已没有了当年的那种热闹与喧嚣，但大洋彼岸的Go团队却始终保持稳中有增的开发和语言演进节奏。今晨Go核心团队的Russ Cox代表Go语言项目团队在Go官博上发表了《Fourteen Years of Go》的博文，纪念Go语言开源14周年，并对2023年...</description></item><item><title>聊聊Go语言的向前兼容性和toolchain规则</title><link>https://tonybai.com/2023/09/10/understand-go-forward-compatibility-and-toolchain-rule/</link><pubDate>Sun, 10 Sep 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/09/10/understand-go-forward-compatibility-and-toolchain-rule/</guid><description>本文永久链接 – https://tonybai.com/2023/09/10/understand-go-forward-compatibility-and-toolchain-rule Go语言在发展演进过程中一直十分注重向后兼容性(backward compatibility)，在Go 1.0版本发布之初就发布了Go1兼容性承诺，简单来说就是保证使用新版本Go(比如Go 1.21版本)可以正...</description></item><item><title>slog正式版来了：Go日志记录新选择！</title><link>https://tonybai.com/2023/09/01/slog-a-new-choice-for-logging-in-go/</link><pubDate>Fri, 01 Sep 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/09/01/slog-a-new-choice-for-logging-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/09/01/slog-a-new-choice-for-logging-in-go 在大约一年前，我就写下了《slog：Go官方版结构化日志包》一文，文中介绍了Go团队正在设计并计划在下一个Go版本中落地的Go官方结构化日志包：slog。但slog并未如预期在Go 1.20版本中落地，而是在golang.org/x/exp/slo...</description></item><item><title>编译Go应用的黑盒挑战：无源码只有.a文件，你能搞定吗？</title><link>https://tonybai.com/2023/08/30/how-to-build-with-only-archive-in-go/</link><pubDate>Wed, 30 Aug 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/08/30/how-to-build-with-only-archive-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/08/30/how-to-build-with-only-archive-in-go 上周末，一个Gopher在微信上与我交流了一个有关Go程序编译的问题。他的述求说起来也不复杂，那就是合作公司提供的API包仅包括golang archive(使用go build -buildmode=archive构建的.a文件)，没有Go包的...</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/06/04/reflection-programming-guide-in-go/</link><pubDate>Sun, 04 Jun 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/06/04/reflection-programming-guide-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/06/04/reflection-programming-guide-in-go 反射是一种编程语言的高级特性，它允许程序在运行时检视自身的结构和行为。通过反射，程序可以动态地获取类型(type)与值(value)等信息，并对它们进行操作，诸如修改字段、调用方法等，这使得程序具有更大的灵活性和可扩展性。 不过，反射虽然具有强大的功...</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>理解unsafe-assume-no-moving-gc包</title><link>https://tonybai.com/2023/04/16/understanding-unsafe-assume-no-moving-gc/</link><pubDate>Sun, 16 Apr 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/04/16/understanding-unsafe-assume-no-moving-gc/</guid><description>本文永久链接 – https://tonybai.com/2023/04/16/understanding-unsafe-assume-no-moving-gc 1\. 背景 ------ 在之前的《Go与神经网络：张量计算》一文中，不知道大家是否发现了，所有例子代码执行时，前面都加了一个环境变量ASSUME\_NO\_MOVING\_GC\_UNSAFE\_RISK\_IT\_WITH，就像下面...</description></item><item><title>一文告诉你当module path为main时执行go test失败的真正原因</title><link>https://tonybai.com/2023/04/08/the-reason-why-go-test-fails-when-module-path-is-main/</link><pubDate>Sat, 08 Apr 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/04/08/the-reason-why-go-test-fails-when-module-path-is-main/</guid><description>本文永久链接 – https://tonybai.com/2023/04/08/the-reason-why-go-test-fails-when-module-path-is-main 近期收到新加入“Gopher部落”知识星球的星友“凌风”的一个问题，内容如下： 在一个目录下，我编写了a.go和a_test.go，在go mod init main后执行go test，会报错：could no...</description></item><item><title>Go开发命令行程序指南</title><link>https://tonybai.com/2023/03/25/the-guide-of-developing-cli-program-in-go/</link><pubDate>Sat, 25 Mar 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/03/25/the-guide-of-developing-cli-program-in-go/</guid><description>&amp;gt; 注：上面篇首配图的底图由百度文心一格生成。 本文永久链接 – https://tonybai.com/2023/03/25/the-guide-of-developing-cli-program-in-go 近期在Twitter上看到一个名为“Command Line Interface Guidelines”的站点，这个站点汇聚了帮助大家编写出更好命令行程序的哲学与指南。这份指南基于传统的U...</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年博客回顾与总结</title><link>https://tonybai.com/2023/01/11/2022-blog-summary/</link><pubDate>Wed, 11 Jan 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/01/11/2022-blog-summary/</guid><description>本文永久链接 – https://tonybai.com/2023/01/11/2022-blog-summary 2022年对我来说，也是**十分忙碌和充实的一年**。尽管和2021年相比，成果物没那么多^\_^。 伴随着二宝的长大，我发现自己的闲暇时间被进一步“压缩”，还好大宝上初中后领悟到了自驱学习的重要性和相关方法后，她的学习现在基本不需要我过问了。 2022年初，《Go语言精进之路：从新...</description></item><item><title>Go 1.20新特性前瞻</title><link>https://tonybai.com/2022/11/17/go-1-20-foresight/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/11/17/go-1-20-foresight/</guid><description>本文永久链接 – https://tonybai.com/2022/11/17/go-1-20-foresight * * * 在近期Russ Cox代表Go核心团队发表的“Go, 13周年”一文中，他提到了“在Go的第14个年头，Go团队将继续努力使Go成为用于大规模软件工程的最好的环境，将特别关注供应链安全，提高兼容性和结构化日志记录，当然还会有很多其他改进，包括profile-guided ...</description></item><item><title>通过实例理解Go标准库context包</title><link>https://tonybai.com/2022/11/08/understand-go-context-by-example/</link><pubDate>Tue, 08 Nov 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/11/08/understand-go-context-by-example/</guid><description>* **原weibo账号处于jy状态，临时先用小号 https://weibo.com/u/6484441286，欢迎大家关注！** * “Gopher部落”知识星球双十一新人特惠，领劵加入即享立减88元优惠 – https://t.zsxq.com/078E1QTjM 本文永久链接 – https://tonybai.com/2022/11/08/understand-go-context-by...</description></item><item><title>Gopher部落：2022年要做的事儿</title><link>https://tonybai.com/2022/03/06/the-2022-plan-of-gopher-tribe/</link><pubDate>Sun, 06 Mar 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/03/06/the-2022-plan-of-gopher-tribe/</guid><description>本文永久链接 – https://tonybai.com/2022/03/06/the-2022-plan-of-gopher-tribe 2021年末，我对Gopher部落知识星球的这一年进行了简单的复盘。2022年初，我陆续收到知识星球官方的一些排名数据： 这些数据让我对2022年星球的运营更加有信心了！那么，2022年Gopher部落知识星球会有哪些变化呢？在本文中，我就来说一说这方面内容。...</description></item></channel></rss>