<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Viper - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/viper/</link><description>Viper - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Sun, 12 Jan 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/viper/" rel="self" type="application/rss+xml"/><item><title>Golang 程序加载配置最佳实践</title><link>https://rd163.visword.com/posts/best-practice-for-go-conf/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/best-practice-for-go-conf/</guid><description><![CDATA[<p>程序的配置（key、连接串、端口、特性开关等）往往会随部署环境（dev / staging / prod）变化，而代码本身不变。这正是 <a href="https://12factor.net/config" target="_blank" rel="noopener noreferrer">Twelve-Factor App</a> 中「配置（Config）」一章的核心观点:<strong>配置应与代码严格分离</strong>,且推荐将环境相关的配置放进环境变量（env vars）,因为它们易于在不同部署间切换、不易被误提交进版本库，并且与语言和操作系统无关。</p>]]></description></item></channel></rss>