<?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>Stub on Tony Bai</title><link>https://tonybai.com/tags/stub/</link><description>Recent content in Stub on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Wed, 14 Jan 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/stub/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 的“显式哲学”为何在接口上“食言”了？—— 探秘隐式接口背后的设计智慧</title><link>https://tonybai.com/2026/01/14/go-explicit-philosophy-implicit-interfaces-design-wisdom/</link><pubDate>Wed, 14 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/14/go-explicit-philosophy-implicit-interfaces-design-wisdom/</guid><description>本文永久链接 – https://tonybai.com/2026/01/14/go-explicit-philosophy-implicit-interfaces-design-wisdom 大家好，我是Tony Bai。 “Go 倾向于显式、冗长的代码，而不是‘魔法’。那么，为什么接口实现却是**隐式**的呢？这让理解代码变得困难多了，简直让我抓狂。” 前不久，一位 Gopher 在 Redd...</description></item><item><title>Go语言中的SIMD加速：以矩阵加法为例</title><link>https://tonybai.com/2024/07/21/simd-in-go/</link><pubDate>Sun, 21 Jul 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/07/21/simd-in-go/</guid><description>本文永久链接 – https://tonybai.com/2024/07/21/simd-in-go 前些日子，一些资深Gopher，比如fasthttp的作者Aliaksandr Valialkin因函数迭代器加入Go 1.23版本而抱怨Go的演进走错了方向：朝着增加复杂性和隐式代码执行的方向发展，而没有专注于Go语言的基本设计哲学——简单性、生产力和性能。Valialkin希望Go团队能专注于...</description></item><item><title>Go语言gRPC服务Handler单元测试详解</title><link>https://tonybai.com/2023/11/25/grpc-handler-unit-testing-in-go/</link><pubDate>Sat, 25 Nov 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/11/25/grpc-handler-unit-testing-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/11/25/grpc-handler-unit-testing-in-go 在云原生时代和微服务架构背景下，HTTP和RPC协议成为服务间通信和与客户端交互的两种主要方式。对于Go语言而言，标准库提供了net/http/httptest包，为开发人员提供了便捷的方式来构建服务端HTTP Handler单元测试的测试脚手架代码，而无...</description></item><item><title>使用testify包辅助Go测试指南</title><link>https://tonybai.com/2023/07/16/the-guide-of-go-testing-with-testify-package/</link><pubDate>Sun, 16 Jul 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/07/16/the-guide-of-go-testing-with-testify-package/</guid><description>本文永久链接 – https://tonybai.com/2023/07/16/the-guide-of-go-testing-with-testify-package 我虽然算不上Go标准库的“清教徒”，但在测试方面还多是基于标准库testing包以及go test框架的，除了需要mock的时候，基本上没有用过第三方的Go测试框架。我在《Go语言精进之路》一书中对Go测试组织的讲解也是基于Go ...</description></item><item><title>单测时尽量用fake object</title><link>https://tonybai.com/2023/04/20/provide-fake-object-for-external-collaborators/</link><pubDate>Thu, 20 Apr 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/04/20/provide-fake-object-for-external-collaborators/</guid><description>本文永久链接 – https://tonybai.com/2023/04/20/provide-fake-object-for-external-collaborators 1\. 单元测试的难点：外部协作者(external collaborators)的存在 -------------------------------------------- 单元测试是软件开发的一个重要部分，它有助于在开...</description></item></channel></rss>