<?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>Array on Tony Bai</title><link>https://tonybai.com/tags/array/</link><description>Recent content in Array on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Sat, 05 Jul 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/array/index.xml" rel="self" type="application/rss+xml"/><item><title>读懂Go的设计哲学：为什么说它是“恰到好处”的80/20语言？</title><link>https://tonybai.com/2025/07/05/go-is-8020-language/</link><pubDate>Sat, 05 Jul 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/07/05/go-is-8020-language/</guid><description>读懂Go的设计哲学：为什么说它是“恰到好处”的80/20语言？ - 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>Go 1.22新特性前瞻</title><link>https://tonybai.com/2023/12/25/go-1-22-foresight/</link><pubDate>Mon, 25 Dec 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/12/25/go-1-22-foresight/</guid><description>本文永久链接 – https://tonybai.com/2023/12/25/go-1-22-foresight 美国时间2023年12月20日，Go官方宣布Go 1.22rc1发布，开启了为期2个多月的、常规的公测之旅，Go 1.22预计将于2024.2月份正式发布！ 除了在官网下载Go 1.22rc1版本进行新特性体验之外，我们还可以通过在线的Go Playground选择“Go dev b...</description></item><item><title>Go语言开发者的Apache Arrow使用指南：读写Parquet文件</title><link>https://tonybai.com/2023/07/31/a-guide-of-using-apache-arrow-for-gopher-part6/</link><pubDate>Mon, 31 Jul 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/07/31/a-guide-of-using-apache-arrow-for-gopher-part6/</guid><description>本文永久链接 – https://tonybai.com/2023/07/31/a-guide-of-using-apache-arrow-for-gopher-part6 Apache Arrow是一种开放的、与语言无关的列式内存格式，在本系列文章的前几篇中，我们都聚焦于内存表示与内存操作。 但对于一个数据库系统或大数据分析平台来说，数据不能也无法一直放在内存中，虽说目前内存很大也足够便宜了，但...</description></item><item><title>Go语言开发者的Apache Arrow使用指南：扩展compute包</title><link>https://tonybai.com/2023/07/22/a-guide-of-using-apache-arrow-for-gopher-part5/</link><pubDate>Sat, 22 Jul 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/07/22/a-guide-of-using-apache-arrow-for-gopher-part5/</guid><description>本文永久链接 – https://tonybai.com/2023/07/22/a-guide-of-using-apache-arrow-for-gopher-part5 在本系列文章的第4篇《Go语言开发者的Apache Arrow使用指南：数据操作》中我们遇到了**大麻烦**：Go的Arrow实现居然不支持像max、min、sum这样的简单聚合计算函数:(，分组聚合(grouped aggr...</description></item><item><title>Go语言开发者的Apache Arrow使用指南：数据操作</title><link>https://tonybai.com/2023/07/13/a-guide-of-using-apache-arrow-for-gopher-part4/</link><pubDate>Thu, 13 Jul 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/07/13/a-guide-of-using-apache-arrow-for-gopher-part4/</guid><description>本文永久链接 – https://tonybai.com/2023/07/13/a-guide-of-using-apache-arrow-for-gopher-part4 在前面的Arrow系列文章中，我们介绍了Arrow的基础数据类型以及高级数据类型，这让我们具备了在内存中建立起一个immutable数据集的能力。但这并非我们的目标，我们最终是要对建立起来的数据集进行查询和分析等操作(mani...</description></item><item><title>Go语言开发者的Apache Arrow使用指南：高级数据结构</title><link>https://tonybai.com/2023/07/08/a-guide-of-using-apache-arrow-for-gopher-part3/</link><pubDate>Sat, 08 Jul 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/07/08/a-guide-of-using-apache-arrow-for-gopher-part3/</guid><description>本文永久链接 – https://tonybai.com/2023/07/08/a-guide-of-using-apache-arrow-for-gopher-part3 经过对前面两篇文章《Arrow数据类型》和《Arrow Go实现的内存管理》的学习，我们知道了各种Arrow array type以及它们在内存中的layout，我们了解了Go arrow实现在内存管理上的一些机制和使用原则。...</description></item><item><title>Go语言开发者的Apache Arrow使用指南：内存管理</title><link>https://tonybai.com/2023/06/30/a-guide-of-using-apache-arrow-for-gopher-part2/</link><pubDate>Fri, 30 Jun 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/06/30/a-guide-of-using-apache-arrow-for-gopher-part2/</guid><description>本文永久链接 – https://tonybai.com/2023/06/30/a-guide-of-using-apache-arrow-for-gopher-part2 如果你看了上一篇《Go语言开发者的Apache Arrow使用指南：数据类型》中的诸多Go操作arrow的代码示例，你很可能会被代码中大量使用的Retain和Release方法搞晕。不光大家有这样的感觉，我也有同样的feeli...</description></item><item><title>Go语言开发者的Apache Arrow使用指南：数据类型</title><link>https://tonybai.com/2023/06/25/a-guide-of-using-apache-arrow-for-gopher-part1/</link><pubDate>Sun, 25 Jun 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/06/25/a-guide-of-using-apache-arrow-for-gopher-part1/</guid><description>本文永久链接 – https://tonybai.com/2023/06/25/a-guide-of-using-apache-arrow-for-gopher-part1 如果你不是做大数据分析的，提到Arrow这个词，你可能会以为我要聊聊那个箭牌卫浴或是箭牌口香糖(注：其实箭牌口香糖使用的单词并非Arrow)。其实我要聊的是Apache的一个顶级项目：Arrow。 为什么要聊这个项目呢？说来话...</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语言的控制语句</title><link>https://tonybai.com/2023/05/27/control-flow-statement-in-go/</link><pubDate>Sat, 27 May 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/05/27/control-flow-statement-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/05/27/control-flow-statement-in-go 在高级编程语言中，控制流语句(control-flow statement)是一类用于控制程序执行流程的语句，以下简称为**控制语句**。它们可以根据条件或循环执行相应的代码块，或者跳转到指定位置执行代码。 常见的控制语句包括： * 条件语句：根据条件执行不同的...</description></item><item><title>Go：值与指针</title><link>https://tonybai.com/2023/05/05/go-value-and-pointer/</link><pubDate>Fri, 05 May 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/05/05/go-value-and-pointer/</guid><description>本文永久链接 – https://tonybai.com/2023/05/05/go-value-and-pointer 1\. 计算机中的值 ---------- 在百万年的演化历史中，人类对事物的属性进行了抽象，有了数量、精度、信息等概念的表示，对应的我们称之为整数、小数、文本文字等。计算机出现后，我们使用计算机对真实世界的问题进行建模，通过计算机的高效计算解决这些问题并输出答案。为了建模，计...</description></item><item><title>一文告诉你哪些map element类型支持就地更新</title><link>https://tonybai.com/2023/04/02/map-element-types-support-in-place-update/</link><pubDate>Sun, 02 Apr 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/04/02/map-element-types-support-in-place-update/</guid><description>本文永久链接 – https://tonybai.com/2023/04/02/map-element-types-support-in-place-update 年初，我代表团队和人民邮电出版社签订了翻译《Go Fundamentals》一书的合同，本月底便是四分之一进度的交稿时间点，近期闲时我们都在忙着做交叉review。 上周末我review小伙伴翻译的有关map类型的章节时，看到了书中对m...</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>将Roaring Bitmap序列化为JSON</title><link>https://tonybai.com/2023/02/01/serialize-roaring-bitmap-to-json/</link><pubDate>Wed, 01 Feb 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/02/01/serialize-roaring-bitmap-to-json/</guid><description>本文永久链接 – https://tonybai.com/2023/02/01/serialize-roaring-bitmap-to-json 近期在实现一个数据结构时使用到了位图索引(bitmap index)，本文就来粗浅聊聊位图(bitmap)。 一. 什么是bitmap 位图索引使用位数组(bit array，也有叫bitset的，通常被称为位图(bitmap)，以下均使用bitmap这...</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>当函数设计遇到切片</title><link>https://tonybai.com/2022/10/27/when-encountering-slice-during-function-design/</link><pubDate>Thu, 27 Oct 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/10/27/when-encountering-slice-during-function-design/</guid><description>本文永久链接 – https://tonybai.com/2022/10/27/when-encountering-slice-during-function-design 切片(slice)是Go语言中的一种重要的也是最常用的同构数据类型。在Go语言编码过程中，我们多数情况下会使用slice替代数组，一来是因为其动态可扩展，二来在多数场合传递slice的开销要比传递数组要小(这里有一些例外)。 ...</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语言的“黑暗角落”：盘点学习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>写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>C,C++开源项目中的100个Bugs</title><link>https://tonybai.com/2013/04/10/100-bugs-in-c-cpp-opensource-projects/</link><pubDate>Wed, 10 Apr 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/04/10/100-bugs-in-c-cpp-opensource-projects/</guid><description>俄罗斯OOO Program Verification Systems公司用自己的静态源码分析产品PVS-Studio对一些知名的C/C++开源项目，诸如Apache Http Server、Chromium、Clang、CMake、MySQL等的源码进行了分析，找出了100个典型的Bugs。个人觉得这份列表对C/C++ 程序员有一定参考意义。与其说事后用静态工具分析，倒不如在编码时就提高自知自觉...</description></item><item><title>简析指针与多维数组</title><link>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/</link><pubDate>Thu, 28 Mar 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/03/28/pointer-and-multi-dimension-array-in-c/</guid><description>上一篇文章中对多级指针做了简要分析，其实只有当指针与多维数组以及函数联合在一起使用时，麻烦才算真正到来。 **零、数组****与数组名** C语言)中的数组的一般声明形式如下： T arr\_name\[n\]; /\* T为类型，n为数组元素个数 \*/ 从**内存布局**角度来说，数组T arr\_name\[n\]就是内存中连续的内存单元，每个内存单元的长度为sizeof(T)，数组的起始内...</description></item></channel></rss>