<?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.13 on Tony Bai</title><link>https://tonybai.com/tags/go1.13/</link><description>Recent content in Go1.13 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Wed, 15 Oct 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/go1.13/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 考古：defer 的“救赎”——从性能“原罪”到零成本的“开放编码”</title><link>https://tonybai.com/2025/10/15/go-archaeology-defer/</link><pubDate>Wed, 15 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/15/go-archaeology-defer/</guid><description>本文永久链接 – https://tonybai.com/2025/10/15/go-archaeology-defer 大家好，我是Tony Bai。 在 Go 语言的所有关键字中，defer 无疑是最具特色和争议的之一。它以一种近乎“魔法”的方式，保证了资源清理逻辑的执行，极大地提升了代码的可读性和健壮性。f, _ := os.Open(“…”); defer f.Close() 这一行代码，...</description></item><item><title>泛型重塑 Go 错误检查：errors.As 的下一站 AsA？</title><link>https://tonybai.com/2025/08/23/proposal-errors-asa/</link><pubDate>Sat, 23 Aug 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/08/23/proposal-errors-asa/</guid><description>本文永久链接 – https://tonybai.com/2025/08/23/proposal-errors-asa 大家好，我是Tony Bai。 自 Go 1.13 引入 errors.Is 和 errors.As 以来，Go 语言的错误处理进入了一个结构化、可追溯的新时代。然而，errors.As 的使用方式，对于追求代码简洁与优雅的 Gopher 而言，始终存在一丝“不和谐”：开发者必须...</description></item><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>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>聊聊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>Go标准库依赖的那些modules</title><link>https://tonybai.com/2022/10/25/the-modules-that-go-standard-library-depend-on/</link><pubDate>Tue, 25 Oct 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/10/25/the-modules-that-go-standard-library-depend-on/</guid><description>本文永久链接 – https://tonybai.com/2022/10/25/the-modules-that-go-standard-library-depend-on 对于程序员来说，编写的代码依赖标准库是“天经地义”的事情。标准库在程序员眼中就是高质量的代名词，也是最值得信赖的非自己所写的代码，当然更是代码包依赖关系链条上的最后一环，即所有直接或间接依赖的第三方module最终都会依赖标准...</description></item><item><title>我来告诉你Go项目标准结构如何布局</title><link>https://tonybai.com/2022/04/28/the-standard-layout-of-go-project/</link><pubDate>Thu, 28 Apr 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/04/28/the-standard-layout-of-go-project/</guid><description>本文永久链接 – https://tonybai.com/2022/04/28/the-standard-layout-of-go-project 每当我们编写一个非hello world的实用Go程序或库时，我们都会在项目结构、代码风格以及标识符命名这三个“门槛”前面踯躅徘徊许久，甚至始终得不到满意答案。 本文将通过《Go语言精进之路：从新手到高手的编程思想、方法与技巧》这本书的内容来详细看一看...</description></item><item><title>聊聊Go语言的软件供应链安全</title><link>https://tonybai.com/2022/03/14/software-supply-chain-security-in-go/</link><pubDate>Mon, 14 Mar 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/03/14/software-supply-chain-security-in-go/</guid><description>本文永久链接 – https://tonybai.com/2022/03/14/software-supply-chain-security-in-go 在Go 12岁生日以及Go 1.18 beta1发布的博文中，Go核心团队技术负责人Russ Cox都提到了2022年Go团队将关注Go软件供应链安全，并在Go中为软件供应链提供相关工具。 提到供应链，我们立马想到的它是制造业的存在，在软件开发领...</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>Go 1.15中值得关注的几个变化</title><link>https://tonybai.com/2020/10/11/some-changes-in-go-1-15/</link><pubDate>Sun, 11 Oct 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/10/11/some-changes-in-go-1-15/</guid><description>Go 1.15版本在8月12日就正式发布了，给我的感觉就是发布的挺痛快^\_^。这种感觉来自与之前版本发布时间的对比：Go 1.13版本发布于当年的9月4日，更早的Go 1.11版本发布于当年的8月25日。 不过这个时间恰与我家二宝出生和老婆月子时期有重叠，每天照顾孩子团团转的我实在抽不出时间研究Go 1.15的变化:(。如今，我逐渐从照顾二宝的工作中脱离出来^\_^，于是“Go x.xx版本值得...</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运行时调度器</title><link>https://tonybai.com/2020/03/21/illustrated-tales-of-go-runtime-scheduler/</link><pubDate>Sat, 21 Mar 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/03/21/illustrated-tales-of-go-runtime-scheduler/</guid><description>本文翻译自《Illustrated Tales of Go Runtime Scheduler》。 &amp;gt; 译注：原文章结构有些乱，笔者自行在译文中增加了一些分级标题，让结构显得更清晰一些:)。 多goroutines形式的Go并发是编写现代并发软件的一种非常方便的方法，但是您的Go程序是如何高效地运行这些goroutines的呢？ 在这篇文章中，我们将深入Go运行时底层，从设计角度了解Go运行时调度...</description></item><item><title>Go 1.14中值得关注的几个变化</title><link>https://tonybai.com/2020/03/08/some-changes-in-go-1-14/</link><pubDate>Sun, 08 Mar 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/03/08/some-changes-in-go-1-14/</guid><description>可能是得益于2020年2月26日Go 1.14的发布，在2020年3月份的TIOBE编程语言排行榜上，Go重新进入TOP 10，而去年同期Go仅排行在第18位。虽然Go语言以及其他主流语言在榜单上的“上蹿下跳”让这个榜单的权威性饱受质疑:)，但Go在这样的一个时间节点能进入TOP 10，对于Gopher和Go社区来说，总还是一个不错的结果。并且在一定层度上说明：Go在努力耕耘十年后，已经在世界主流...</description></item><item><title>Go 1.13中值得关注的几个变化</title><link>https://tonybai.com/2019/10/27/some-changes-in-go-1-13/</link><pubDate>Sun, 27 Oct 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/10/27/some-changes-in-go-1-13/</guid><description>2019年对于Go语言来说也是一个重要的年份，因为在2019年的11月10日，Go即将迎来其开源10周年的纪念日。在这个重要日子的前夕，在GopherCon 2019大会后，Go项目组在2019.9.4日发布了Go 1.13版本。 这是自2017年GopherCon大会上Russ Cox做“Toward Go 2″主题演讲以来Go项目发布的第四个版本（前三个分别是：go 1.10、go 1.11和...</description></item><item><title>Go 1.13中的错误处理</title><link>https://tonybai.com/2019/10/18/errors-handling-in-go-1-13/</link><pubDate>Fri, 18 Oct 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/10/18/errors-handling-in-go-1-13/</guid><description>介绍 -- 在过去的十年中， Go的errors are values的理念在编码实践中运行得也很良好。尽管标准库对错误处理的的支持很少（只有errors.New和fmt.Errorf函数可以用来构造仅包含字符串消息的错误），但是内置的error接口使Go程序员可以添加所需的任何信息。它所需要的只是一个实现Error方法的类型： type QueryError struct { Query str...</description></item><item><title>Go语言包管理简史</title><link>https://tonybai.com/2019/09/21/brief-history-of-go-package-management/</link><pubDate>Sat, 21 Sep 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/09/21/brief-history-of-go-package-management/</guid><description>包管理是Go一直被诟病做得不好的功能之一。先前版本（go 1.11之前）的主要缺点之一是go get是缺乏对依赖包版本的管理和对可复制构建(reproducible build)的支持。Go社区已经开发了一些包管理器和工具作为版本化包依赖的事实标准解决方案，如glide，dep以及一些辅助工具等。 &amp;gt; “我在生产构建中使用go get。” – 没有人这么说过。 Go语言的包管理实现可追溯到Goog...</description></item><item><title>Go语言回顾：从Go 1.0到Go 1.13</title><link>https://tonybai.com/2019/09/07/go-retrospective/</link><pubDate>Sat, 07 Sep 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/09/07/go-retrospective/</guid><description>Go 1.13版本在2019.9.3正式发布！国外的Gopher Vincent Blanchon发表了一篇文章《Go: Retrospective》(科学上网阅读)，对Go从1.0版本到1.13版本做了简要的回顾，这里是那篇文章的译文。 对于每一位Go开发者来说，Go语言的演化历程是必须要知道的事情。了解这些横跨年份发布的大版本的主要变化将有助于Gopher理解Go语言的发展理念以及该语言每个版...</description></item><item><title>Go module机制下升级major版本号的实践</title><link>https://tonybai.com/2019/06/03/the-practice-of-upgrading-major-version-under-go-module/</link><pubDate>Mon, 03 Jun 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/06/03/the-practice-of-upgrading-major-version-under-go-module/</guid><description>Go module机制在Go 1.11版本引入，虽然也伴随着不小的质疑声，但总体上Go社区多数Gopher是接受go module的，很多标杆式的Go项目(比如kubernetes、kubernetes client-go等)也都逐渐转向了Go module，并且Gopher也在向core team反馈了自己的建议和问题。Go core team也在go module最初设计的基础上持续进行着改进...</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></channel></rss>