<?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>作用域 on Tony Bai</title><link>https://tonybai.com/tags/%E4%BD%9C%E7%94%A8%E5%9F%9F/</link><description>Recent content in 作用域 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Tue, 21 Oct 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E4%BD%9C%E7%94%A8%E5%9F%9F/index.xml" rel="self" type="application/rss+xml"/><item><title>写出让同事赞不绝口的Go代码：Reddit工程师总结的10条地道Go编程法则</title><link>https://tonybai.com/2025/10/21/10-go-programming-rules-from-reddit/</link><pubDate>Tue, 21 Oct 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/10/21/10-go-programming-rules-from-reddit/</guid><description>本文永久链接 – https://tonybai.com/2025/10/21/10-go-programming-rules-from-reddit 大家好，我是Tony Bai。 在团队协作中，Code Review是我们与同事交流最频繁的阵地。我们都渴望自己提交的代码能够清晰、健壮，赢得同事的“LGTM”（Looks Good To Me）。但有时，一些看似“吹毛求疵”的风格评论，如“改下变...</description></item><item><title>Go的“七宗罪”：一篇“Go依然不够好”如何引爆社区激辩？</title><link>https://tonybai.com/2025/08/25/go-is-still-not-good/</link><pubDate>Mon, 25 Aug 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/08/25/go-is-still-not-good/</guid><description>本文永久链接 – https://tonybai.com/2025/08/25/go-is-still-not-good 大家好，我是Tony Bai。 在技术圈，平静的湖面下往往暗流涌动。对于Go语言社区而言，这股潜藏已久的暗流，被近期的一篇名为《Go is still not good》的博文彻底引爆。作者Thomas Habets，一位自称拥有超过十年Go使用经验的资深开发者，在他的这篇文章...</description></item><item><title>Go方法名的作用域：包级，但需间接调用</title><link>https://tonybai.com/2025/03/24/understand-methodname-scope/</link><pubDate>Mon, 24 Mar 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/03/24/understand-methodname-scope/</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/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>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 Code Block和变量作用域的代码的简要分析</title><link>https://tonybai.com/2018/05/11/the-analysis-of-a-go-code-snippet-about-code-blocks-and-scope/</link><pubDate>Fri, 11 May 2018 00:00:00 +0800</pubDate><guid>https://tonybai.com/2018/05/11/the-analysis-of-a-go-code-snippet-about-code-blocks-and-scope/</guid><description>近期，Go team的David CrawShaw在twitter上贴出了一段代码，如下： func main() { if a := 1; false { } else if b := 2; false { } else if c := 3; false { } else { println(a, b, c) } } David CrawShaw想表达的意图是gopher们很少在”else if...</description></item><item><title>一个有关Golang变量作用域的坑</title><link>https://tonybai.com/2015/01/13/a-hole-about-variable-scope-in-golang/</link><pubDate>Tue, 13 Jan 2015 00:00:00 +0800</pubDate><guid>https://tonybai.com/2015/01/13/a-hole-about-variable-scope-in-golang/</guid><description>临近下班前编写和调试一段Golang代码，但运行结果始终与期望不符，怪异的很，下班前依旧无果。代码Demo如下： //testpointer.go package main import (         &amp;#34;fmt&amp;#34; ) var p \*int func foo() (\*int, error) {         var i int = 5         return &amp;amp;i, nil } f...</description></item><item><title>走马观花ANSI C标准-标识符</title><link>https://tonybai.com/2005/08/05/c-standard-overview-identifier/</link><pubDate>Fri, 05 Aug 2005 00:00:00 +0800</pubDate><guid>https://tonybai.com/2005/08/05/c-standard-overview-identifier/</guid><description>标识符(identifier) 1、一个标识符可以表示: a) 对象(object) b) 函数(function) c) 结构体(struct)的标签(Tag)\[注1] d) 结构体的成员 e) 联合体(union)或枚举类型(enumeration) f) 类型别名(typedef) g) 标签(label) h) 宏(macro) i) 宏参数(macro parameter) 同一个标识...</description></item></channel></rss>