<?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>Make on Tony Bai</title><link>https://tonybai.com/tags/make/</link><description>Recent content in Make on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Mon, 11 Nov 2024 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/make/index.xml" rel="self" type="application/rss+xml"/><item><title>Go编译的几个细节，连专家也要停下来想想</title><link>https://tonybai.com/2024/11/11/some-details-about-go-compilation/</link><pubDate>Mon, 11 Nov 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/11/11/some-details-about-go-compilation/</guid><description>本文永久链接 – https://tonybai.com/2024/11/11/some-details-about-go-compilation 在Go开发中，编译相关的问题看似简单，但实则蕴含许多细节。有时，即使是Go专家也需要停下来，花时间思考答案或亲自验证。本文将通过几个具体问题，和大家一起探讨Go编译过程中的一些你可能之前未曾关注的细节。 &amp;gt; 注：本文示例使用的环境为Go 1.23.0、...</description></item><item><title>Go weak包前瞻：弱指针为内存管理带来新选择</title><link>https://tonybai.com/2024/09/23/go-weak-package-preview/</link><pubDate>Mon, 23 Sep 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/09/23/go-weak-package-preview/</guid><description>Go weak包前瞻：弱指针为内存管理带来新选择 | Tony Bai =============== Tony Bai一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * 关于我 * 文章列表 Go weak包前...</description></item><item><title>Go unique包：突破字符串局限的通用值Interning技术实现</title><link>https://tonybai.com/2024/09/18/understand-go-unique-package-by-example/</link><pubDate>Wed, 18 Sep 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/09/18/understand-go-unique-package-by-example/</guid><description>本文永久链接 – https://tonybai.com/2024/09/18/understand-go-unique-package-by-example Go的1.23版本中引入了一个新的标准库包unique，为Go开发者带来了高效的值interning能力)。这种能力不仅适用于字符串类型值，还可应用于任何可比较(comparable)类型的值。 本文将简要探讨interning技术及其在G...</description></item><item><title>编译Go应用的黑盒挑战：无源码只有.a文件，你能搞定吗？</title><link>https://tonybai.com/2023/08/30/how-to-build-with-only-archive-in-go/</link><pubDate>Wed, 30 Aug 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/08/30/how-to-build-with-only-archive-in-go/</guid><description>本文永久链接 – https://tonybai.com/2023/08/30/how-to-build-with-only-archive-in-go 上周末，一个Gopher在微信上与我交流了一个有关Go程序编译的问题。他的述求说起来也不复杂，那就是合作公司提供的API包仅包括golang archive(使用go build -buildmode=archive构建的.a文件)，没有Go包的...</description></item><item><title>使用反射操作channel</title><link>https://tonybai.com/2022/11/15/using-reflect-to-manipulate-channels/</link><pubDate>Tue, 15 Nov 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/11/15/using-reflect-to-manipulate-channels/</guid><description>本文永久链接 – https://tonybai.com/2022/11/15/using-reflect-to-manipulate-channels * * * 今年教师节极客时间送给讲师4999 SVIP卡，一直没顾过来用，上周激活后在极客时间的众多精品课和专栏中徜徉，收获颇丰。尤其是在拜读鸟窝老师的《Go并发编程实战课》 后，get到一个以前从未用过的“技能点”：**使用reflect操作...</description></item><item><title>让reviewdog支持gitlab-push-commit，守住代码质量下限</title><link>https://tonybai.com/2022/09/08/make-reviewdog-support-gitlab-push-commit-to-preserve-the-code-quality-floor/</link><pubDate>Thu, 08 Sep 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/09/08/make-reviewdog-support-gitlab-push-commit-to-preserve-the-code-quality-floor/</guid><description>本文永久链接 – https://tonybai.com/2022/09/08/make-reviewdog-support-gitlab-push-commit-to-preserve-the-code-quality-floor 一. 代码质量保证的手段 从世界上首款计算机高级程序设计语言Fortran自上世纪50年代诞生以来，编程这个行当已经走过了近70年。虽然年头已不少，但不可否认的一点是...</description></item><item><title>使用Go开发Kubernetes Operator：基本结构</title><link>https://tonybai.com/2022/08/15/developing-kubernetes-operators-in-go-part1/</link><pubDate>Mon, 15 Aug 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/08/15/developing-kubernetes-operators-in-go-part1/</guid><description>本文永久链接 – https://tonybai.com/2022/08/15/developing-kubernetes-operators-in-go-part1 &amp;gt; 注：文章首图基于《Kubernetes Operators Explained》修改 几年前，我还称Kubernetes为服务编排和容器调度领域的事实标准，如今K8s已经是这个领域的“霸主”，地位无可撼动。不过，虽然Kubern...</description></item><item><title>使用Go语言实现eBPF程序内核态与用户态的双向数据交换</title><link>https://tonybai.com/2022/07/25/bidirectional-data-exchange-between-kernel-and-user-states-of-ebpf-programs-using-go/</link><pubDate>Mon, 25 Jul 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/07/25/bidirectional-data-exchange-between-kernel-and-user-states-of-ebpf-programs-using-go/</guid><description>本文永久链接 – https://tonybai.com/2022/07/25/bidirectional-data-exchange-between-kernel-and-user-states-of-ebpf-programs-using-go 在之前的两篇文章中，无论是使用C语言开发eBPF程序，还是使用Go开发的eBPF程序，都是hello world级别的，可能有用，但谈不上十分实用。 ...</description></item><item><title>使用Go语言开发eBPF程序</title><link>https://tonybai.com/2022/07/19/develop-ebpf-program-in-go/</link><pubDate>Tue, 19 Jul 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/07/19/develop-ebpf-program-in-go/</guid><description>本文永久链接 – https://tonybai.com/2022/07/19/develop-ebpf-program-in-go 在前面的《使用C语言从头开发一个Hello World级别的eBPF程序》一文中，我们详细说明了如何基于C语言和libbpf库从头开发一个eBPF程序(包括其用户态部分)。那篇文章是后续有关eBPF程序开发文章的基础，因为到目前为止，无论eBPF程序的用户态部分用什...</description></item><item><title>使用Go基于国密算法实现双向认证</title><link>https://tonybai.com/2022/07/17/two-way-authentication-using-go-and-sm-algorithm/</link><pubDate>Sun, 17 Jul 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/07/17/two-way-authentication-using-go-and-sm-algorithm/</guid><description>本文永久链接 – https://tonybai.com/2022/07/17/two-way-authentication-using-go-and-sm-algorithm 国内做2B(to Biz)或2G(to Gov)产品和解决方案的企业都绕不过**国密算法**，越来越多的国内甲方在采购需求中包含了基于国密算法的认证、签名、加密等需求。对于国内的车联网平台来说，支持基于国密的双向认证也是大...</description></item><item><title>使用C语言从头开发一个Hello World级别的eBPF程序</title><link>https://tonybai.com/2022/07/05/develop-hello-world-ebpf-program-in-c-from-scratch/</link><pubDate>Tue, 05 Jul 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/07/05/develop-hello-world-ebpf-program-in-c-from-scratch/</guid><description>本文永久链接 – https://tonybai.com/2022/07/05/develop-hello-world-ebpf-program-in-c-from-scratch * * * 近两年最火的Linux内核技术非eBPF莫属！ 2019年以来，除了eBPF技术自身快速演进之外，基于eBPF技术的观测(Observability)、安全(Security)和网络(Networking)...</description></item><item><title>Go程序员拥抱C语言简明指南</title><link>https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher/</link><pubDate>Mon, 16 May 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher/</guid><description>本文永久链接 – https://tonybai.com/2022/05/16/the-short-guide-of-embracing-c-lang-for-gopher 本文是为于航老师的极客时间专栏《深入C语言和程序运行原理》写的加餐文章《Tony Bai：Go程序员拥抱C语言简明指南》，这里分享给大家，尤其是那些想学习C语言的Gopher们。 * * * 你好，我是Tony Bai。 也许...</description></item><item><title>Go是否支持增量构建？我来告诉你！</title><link>https://tonybai.com/2022/03/21/go-native-support-incremental-build/</link><pubDate>Mon, 21 Mar 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/03/21/go-native-support-incremental-build/</guid><description>本文永久链接 – https://tonybai.com/2022/03/21/go-native-support-incremental-build Go语言**以编译速度快闻名于码农界**。这缘于Go在设计之初就选择抛弃其祖辈C语言的头文件包含机制，选择了以包(package)作为基本编译单元。Go语言的这种以包为基本构建单元的构建模型使得依赖分析变得十分简单，避免了C语言那种通过头文件分析依...</description></item><item><title>Go语言map类型变量背后的那些事儿</title><link>https://tonybai.com/2022/03/15/the-underlying-of-a-map-type-variable/</link><pubDate>Tue, 15 Mar 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/03/15/the-underlying-of-a-map-type-variable/</guid><description>本文永久链接 – https://tonybai.com/2022/03/15/the-underlying-of-a-map-type-variable 切片(slice)和map是Go语言中最常用的两种原生复合数据类型，同时也是最容易使初学者感觉迷惑和“掉坑”的两个类型，这很大程度是因为Go runtime层的存在。什么是Go runtime层？可以参考我在《Go语言第一课FAQ》中的解释。 ...</description></item><item><title>使用Docker Compose构建一键启动的运行环境</title><link>https://tonybai.com/2021/11/26/build-all-in-one-runtime-environment-with-docker-compose/</link><pubDate>Fri, 26 Nov 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/11/26/build-all-in-one-runtime-environment-with-docker-compose/</guid><description>本文永久链接 – https://tonybai.com/2021/11/26/build-all-in-one-runtime-environment-with-docker-compose 如今，不管你是否喜欢，不管你是否承认，微服务架构模式的流行就摆在那里。作为架构师的你，如果再将系统设计成个大单体结构，那么即便不懂技术的领导，都会给你送上几次白眼。好吧，妥协了！开拆！“没吃过猪肉，还没见过...</description></item><item><title>Go语言中常见的几种反模式[译]</title><link>https://tonybai.com/2021/03/31/common-anti-patterns-in-go/</link><pubDate>Wed, 31 Mar 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/03/31/common-anti-patterns-in-go/</guid><description>本文翻译自Saif Sadiq的文章《Common anti-patterns in Go》。 众所周知，编码是一门艺术，就像每个拥有精湛艺术并为之感到骄傲的工匠一样，我们作为开发人员也为我们编写的代码感到自豪。为了获得最佳效果，艺术家不断寻找可提高其手艺的方法和工具。同样，作为开发人员，我们也在不断提高自己的技能，并对”如何写出好的代码”这个最重要的问题的答案保持好奇。 弗雷德里克·布鲁克斯（F...</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函数调用链跟踪的一种实现思路</title><link>https://tonybai.com/2020/12/10/a-kind-of-thinking-about-how-to-trace-function-call-chain/</link><pubDate>Thu, 10 Dec 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/12/10/a-kind-of-thinking-about-how-to-trace-function-call-chain/</guid><description>这篇文章的初衷是想解答知乎上的一位知友提出的问题。没想到完成一种实现后，这个问题居然被删除了。那么既然实现了，就分享出来吧。问题的原文找不到了，问题大致是这样的： 一个程序中存在多个函数调用链都调用了函数D： A1 -&amp;gt; B1 &amp;gt; C1 -&amp;gt; D A2 -&amp;gt; B2 &amp;gt; C2 -&amp;gt; D A3 -&amp;gt; B3 -&amp;gt; C3 -&amp;gt; D ... ... 那么，如果某次函数D被调用时出现了问题，那么怎么知道这个D...</description></item><item><title>go protobuf v1败给了gogo protobuf，那v2呢？</title><link>https://tonybai.com/2020/04/24/gogoprotobuf-vs-goprotobuf-v1-and-v2/</link><pubDate>Fri, 24 Apr 2020 00:00:00 +0800</pubDate><guid>https://tonybai.com/2020/04/24/gogoprotobuf-vs-goprotobuf-v1-and-v2/</guid><description>近期的一个项目有对结构化数据进行序列化和反序列化的需求，该项目具有**performance critical**属性，因此我们在选择序列化库包时是要考虑包的性能的。 github上有一个有关Go序列化方法性能比较的repo：go\_serialization\_benchmarks，这个repo横向比较了数十种数据序列化方法的正确性、性能、内存分配等，并给出了一个结论：推荐**gogo prot...</description></item><item><title>Go语言开源十周年</title><link>https://tonybai.com/2019/11/09/go-opensource-10-years/</link><pubDate>Sat, 09 Nov 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/11/09/go-opensource-10-years/</guid><description>本文翻译自Go官方博客上Russ Cox代表Go核心团队发表的“Go Turns 10″一文。 **生日快乐，Go！** 这个周末，我们庆祝Go正式对外发布10周年，即Go作为开源编程语言和构建现代网络软件生态系统的10周年诞辰。 为了纪念这一时刻，Go gopher的创建者Renee French(用下面的新作)描绘了这个令人愉快的场景： 庆祝Go十周年让我回想起2009年11月上旬，那时我们正...</description></item><item><title>组织Golang代码</title><link>https://tonybai.com/2014/10/21/organize-golang-code/</link><pubDate>Tue, 21 Oct 2014 00:00:00 +0800</pubDate><guid>https://tonybai.com/2014/10/21/organize-golang-code/</guid><description>本月初golang官方blog(需要自己搭梯子)上发布了一篇文章，简要介绍了近几个月Go在一 些技术会议上（比如Google I/O、Gopher SummerFest等）的主题分享并伴有slide链接。其中David Crawshaw的“Organizing Go Code”对Golang的代码风格以及工程组 织的最佳实践进行的总结很是全面和到位，这里按Slide中的思路和内容翻译和摘录如下（部...</description></item><item><title>Recommended C Style and Coding Standards中文版全文</title><link>https://tonybai.com/2013/11/26/the-full-text-of-recommended-c-style-and-coding-standards/</link><pubDate>Tue, 26 Nov 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/11/26/the-full-text-of-recommended-c-style-and-coding-standards/</guid><description>今天无意中打开了托管在Google Code上的“Recommended C Style and Coding Standards”翻译项目，忽感觉通过目录链接的方式查看译文缺少整体感，于是花了点时间将译文全文以single page的形式贴在博客里面，方便大家查看，也算是对该翻译内容的一个备份吧。 **C语言编码风格和标准** **0\. 摘要** 本文翻译自《Recommended C Sty...</description></item><item><title>利用ZooKeeper服务实现分布式系统的Leader选举</title><link>https://tonybai.com/2013/08/23/leader-election-using-zookeeper/</link><pubDate>Fri, 23 Aug 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/08/23/leader-election-using-zookeeper/</guid><description>每次与Java组的同事们坐下来谈技术、谈理想、谈人生时，Java组的同事总会向我们投来羡慕的眼光：卧槽！又是自己开发的工具，太NB了。这时C程序 员们的脸上就会洋溢出自豪的笑容，然后内心骂道：谁让我们没有现成的呢。另一个空间里的某些“无C不欢”们或者某些“C Guru”们会骂道：靠，有了也不用，自己写！ 有时候，C程序员真的有一种下意识：不情愿使用其他语言开发的工具、框架或服务，且比其他程序员更爱...</description></item><item><title>buildc 0.3.1版本发布</title><link>https://tonybai.com/2013/07/15/buildc-0-3-1-release/</link><pubDate>Mon, 15 Jul 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/07/15/buildc-0-3-1-release/</guid><description>随着buildc在内部应用的深入，buildc逐渐进入了以内部需求和问题为主要驱动力的演化模式。我们内部的C应用多是后端服务类应用，个人 觉得具有一定代表性。buildc最初就是为了针对这类C应用而设计的。因此我们内部的需求和问题应该也同样具有一定代表性，而这种演化模式在一 段时间范围内还是有意义的。 buildc 0.3.1版本修正了上一版本的若干bug，并增加了两个新功能。 **\* 提高容错...</description></item><item><title>Python脚本命令行变量的实现</title><link>https://tonybai.com/2013/07/09/an-implementation-of-python-commandline-variables/</link><pubDate>Tue, 09 Jul 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/07/09/an-implementation-of-python-commandline-variables/</guid><description>我们知道Make工具是支持命令行变量的，这种手段为我们提供了很好的灵活性，我们可以通过敲入不同的命令行参数来决定Makefile脚本的行为。 make \[variable1=value1 variable2=value2 ... ... \]。 \Makefile CMODE = 64-bit ifeq ($(CMODE), 64-bit)     CFLAGS += -m64 endif al...</description></item><item><title>今天敲了'一亿次'键盘</title><link>https://tonybai.com/2006/10/19/knock-keyboard-a-hundred-million-times/</link><pubDate>Thu, 19 Oct 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/10/19/knock-keyboard-a-hundred-million-times/</guid><description>终于干完活了，这几天甭提有多忙，今天感觉键盘敲的最多，’一亿次’只是个夸张的虚数，具体多少次，我也没去数^\_^。不过一天下来手指、手掌、肩膀都有些发木，酸酸的，难受极了，估计这就是职业病。 最累的是往CVS中导入代码，其实如果是新工程导入也就简单了，一个cvs import命令就可以搞定，可是项管偏偏把顶层目录给你导了进去，这下子可忙坏了我，需要一个目录一个目录，一个文件一个文件的add和com...</description></item><item><title>一个C++项目的Makefile编写-Tony与Alex的对话系列</title><link>https://tonybai.com/2005/05/23/tony-alex-dialog-on-write-makefile-for-cpp-project/</link><pubDate>Mon, 23 May 2005 00:00:00 +0800</pubDate><guid>https://tonybai.com/2005/05/23/tony-alex-dialog-on-write-makefile-for-cpp-project/</guid><description>Tony : Hey Alex, How are you doing? Alex : 不怎么样。(显得很消沉的样子) Tony : Oh , Really ? What is the matter? Alex : 事情是这样的。最近有一个Unix下的C++项目要求我独自完成，以前都是跟着别人做，现在让自己独立完成，还真是不知道该怎么办，就连一个最简单的项目的Makefile都搞不定。昨晚看了一晚上...</description></item></channel></rss>