Go字符串比较,终于有人讲清楚了
本文永久链接 – https://tonybai.com/2022/04/18/inside-go-string-comparison 西娅(Thea)是一个刚刚入门Go语言的妹子程序员,今天她遇到了一个让她“surprise”的问题。下面就是那段让妹子西娅困惑的Go代码: func main() { s1 := "12345" s2 := "2" fmt.Println(`"12345"...
View Article世界读书日:带你走近Go语言编程思维
本文永久链接 – https://tonybai.com/2022/04/23/taking-a-closer-look-at-programming-thinking-in-go...
View Article我来告诉你Go项目标准结构如何布局
本文永久链接 – https://tonybai.com/2022/04/28/the-standard-layout-of-go-project 每当我们编写一个非hello world的实用Go程序或库时,我们都会在项目结构、代码风格以及标识符命名这三个“门槛”前面踯躅徘徊许久,甚至始终得不到满意答案。...
View ArticleGo编程语言与环境:万字长文复盘导致Go语言成功的那些设计决策[译]
本文永久链接 – https://tonybai.com/2022/05/04/the-paper-of-go-programming-language-and-environment 美国计算机学会通讯(Communications of the...
View Article使用ANTLR和Go实现DSL入门
本文永久链接 – https://tonybai.com/2022/05/10/introduction-of-implement-dsl-using-antlr-and-go 一. 引子 设计与实现一门像Go这样的通用编程语言的确很难!那是世界上少数程序员从事的事业,但是实现一门领域特定语言(Domain Specific Language, DSL)似乎是可行的。...
View ArticleGo程序员拥抱C语言简明指南
本文永久链接 – https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher 本文是为于航老师的极客时间专栏《深入C语言和程序运行原理》写的加餐文章《Tony Bai:Go程序员拥抱C语言简明指南》,这里分享给大家,尤其是那些想学习C语言的Gopher们。 你好,我是Tony Bai。...
View Article绞尽脑汁,帮你理解方法本质并选择正确的receiver类型
本文永久链接 – https://tonybai.com/2022/05/17/understand-the-nature-of-go-method-and-how-to-choose-the-correct-receiver-type...
View Article使用具名返回值巧妙解决泛型函数返回零值的问题
本文永久链接 – https://tonybai.com/2022/05/20/solving-problems-in-generic-function-implementation-using-named-return-values Go语言泛型语法特性在Go...
View Article手把手教你使用ANTLR和Go实现一门DSL语言(第一部分):设计DSL语法与文法
本文永久链接 – https://tonybai.com/2022/05/24/an-example-of-implement-dsl-using-antlr-and-go-part1...
View Article手把手教你使用ANTLR和Go实现一门DSL语言(第二部分):文法验证
本文永久链接 – https://tonybai.com/2022/05/25/an-example-of-implement-dsl-using-antlr-and-go-part2...
View Article手把手教你使用ANTLR和Go实现一门DSL语言(第三部分):建立和验证语义模型
本文永久链接 – https://tonybai.com/2022/05/27/an-example-of-implement-dsl-using-antlr-and-go-part3...
View Article手把手教你使用ANTLR和Go实现一门DSL语言(第四部分):组装语义模型并测试DSL
本文永久链接 – https://tonybai.com/2022/05/28/an-example-of-implement-dsl-using-antlr-and-go-part4...
View Article手把手教你使用ANTLR和Go实现一门DSL语言(第五部分):错误处理
本文永久链接 – https://tonybai.com/2022/05/30/an-example-of-implement-dsl-using-antlr-and-go-part5 无论是端应用还是云应用,要上生产环境,有一件事必须要做好,那就是错误处理。在本系列前面的文章中,我们设计了文法与语法、建立并验证了语义模型,但我们没有特别关注错误处理。在这一篇中,我们就来补上这个环节。...
View Article评点2021-2022年上市的那些Go语言新书
本文永久链接 – https://tonybai.com/2022/06/01/reviewing-those-new-go-language-books-coming-out-in-2021-2022...
View ArticleGo:方法集合中“消失的方法”
本文永久链接 – https://tonybai.com/2022/06/06/the-disappeared-method-in-method-set 在《Go语言第一课》中,我花了三节课对Go方法做了全面细致的讲解,而类型的方法集合是其中的一个重点,因为方法集合决定接口实现,并且课程还分门别类地对各种使用类型嵌入(type...
View ArticleGo 1.19新特性前瞻
本文永久链接 – https://tonybai.com/2022/06/12/go-1-19-foresight 美国时间2022年5月7日,Go 1.19版本开发分支进入新特性冻结(freeze)阶段,即只能修Bug,不能再向Go 1.19版本中增加新特性了。由于上一个版本Go 1.18因引入泛型改动较大,推迟了一个月发布,这直接导致了Go 1.19版本的开发周期被缩短。...
View ArticlePrometheus采不到数据了!居然是Prometheus client包的锅
本文永久链接 – https://tonybai.com/2022/06/15/prometheus-can-not-pick-up-data-because-of-the-prometheus-client-package...
View Article小厂内部私有Go module拉取方案(续)
本文永久链接 – https://tonybai.com/2022/06/18/the-approach-to-go-get-private-go-module-in-house-part2 自从去年在公司搭建了内部私有Go module proxy后,我们的私有代理工作得基本良好。按理说,这篇续篇本不该存在:)。 日子一天天过去,Go团队逐渐壮大,空气中都充满了“Go的香气”。...
View ArticleGo语言数据竞争检测与数据竞争模式
本文永久链接 – https://tonybai.com/2022/06/21/data-race-detection-and-pattern-in-go uber,就是那个早早退出中国打车市场的优步,是Go语言早期接纳者,也是Go技术栈的“重度用户”。uber内部的Go代码仓库有5000w+行Go代码,有2100个Go实现的独立服务,这样的Go应用规模在世界范围内估计也是Top3了吧。...
View Article