<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Toolchain on tenfy's blog</title><link>https://tenfy.cn/tags/toolchain/</link><description>Recent content in Toolchain on tenfy's blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Thu, 28 Dec 2023 13:19:05 +0800</lastBuildDate><atom:link href="https://tenfy.cn/tags/toolchain/index.xml" rel="self" type="application/rss+xml"/><item><title>golang多版本管理</title><link>https://tenfy.cn/posts/gg-golang-version-manager/</link><pubDate>Thu, 28 Dec 2023 13:19:05 +0800</pubDate><guid>https://tenfy.cn/posts/gg-golang-version-manager/</guid><description>&lt;p>在我们的开发环境中，使多个golang版本并存。&lt;/p>
&lt;p>大部分情况下，一个比较新的golang版本就能满足我们的日常的开发需求。
但是项目中，因为协作的原因，或者由于项目启动比较早，可能我们不同的工程需要用不同的golang版本。甚至有些工作用比较新的版本编译不了。
这时候，我们就需要让本地的开发环境支持多个golang版本。&lt;/p></description></item><item><title>tenfyzhong/goenv库介绍</title><link>https://tenfy.cn/posts/introduce-goenv/</link><pubDate>Tue, 17 Oct 2017 18:57:26 +0000</pubDate><guid>https://tenfy.cn/posts/introduce-goenv/</guid><description>&lt;p>&lt;a href="https://github.com/tenfyzhong/goenv">goenv&lt;/a>库将环境变量的值设置到一个结构体里，
以方便使用。类似于encoding/json解析到结构体。&lt;/p>
&lt;h1 id="背景">背景&lt;/h1>
&lt;p>为了简化docker的发布，把配置从配置文件里抽取出来，设置到环境变量里。然后发布docker
容器的时候就不需要再带一个配置文件了。&lt;/p></description></item><item><title>golang交叉编译</title><link>https://tenfy.cn/posts/golang-cross-compile/</link><pubDate>Tue, 17 Oct 2017 09:00:35 +0000</pubDate><guid>https://tenfy.cn/posts/golang-cross-compile/</guid><description>&lt;p>golang的交叉编译。&lt;/p>
&lt;p>golang的交叉编译非常简单，只要配好对应的环境变量后再&lt;code>go build&lt;/code>就可以了。
需要配置以下的环境变量。&lt;/p>
&lt;h1 id="cgo_enabled">&lt;code>CGO_ENABLED&lt;/code>&lt;/h1>
&lt;p>默认情况下这个变量为1。
交叉编译不支持cgo，所以需要关闭cgo。
linux/unix下为&lt;code>CGO_ENABLED=0&lt;/code>。
windows下为&lt;code>set CGO_ENABLED=0&lt;/code>。&lt;/p></description></item></channel></rss>