<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>编程语言 - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/</link><description>编程语言 - 标签 - 研发日志 · 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>Sat, 07 Jun 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/" rel="self" type="application/rss+xml"/><item><title>Go语言Web框架：Beego</title><link>https://rd163.visword.com/posts/golang-beego/</link><pubDate>Sat, 07 Jun 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-beego/</guid><description><![CDATA[<h2 id="beego框架概述" class="headerLink">
    <a href="#beego%e6%a1%86%e6%9e%b6%e6%a6%82%e8%bf%b0" class="header-mark"></a>Beego框架概述</h2><p>Beego是一个用Go语言开发的全栈MVC框架，由国人谢孟军（Asta Xie）开发并维护。它借鉴了Python的Django和Flask等框架的设计思想，同时结合了Go语言的特性，为开发者提供了一套完整的Web开发解决方案。</p>]]></description></item><item><title>Python HTTP 客户端库</title><link>https://rd163.visword.com/posts/python-http-client-libs/</link><pubDate>Wed, 15 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/python-http-client-libs/</guid><description><![CDATA[<h2 id="urlliburllib2" class="headerLink">
    <a href="#urlliburllib2" class="header-mark"></a>urllib、urllib2</h2><p>Python 2 时代常用的标准库 HTTP 客户端是 <code>urllib</code> 和 <code>urllib2</code>,它们提供了 URL 编码、请求构造、认证、重定向等基础能力，让我们能在不依赖第三方库的情况下完成大多数 HTTP 调用。两者的分工略有差异:<code>urllib</code> 偏向基础 URL 处理,<code>urllib2</code> 则在请求定制（如自定义 header、handler、opener）上更强大。</p>]]></description></item><item><title>Conda 的替代品</title><link>https://rd163.visword.com/posts/alternatives-for-conda/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/alternatives-for-conda/</guid><description><![CDATA[<h2 id="背景为什么需要替代品" class="headerLink">
    <a href="#%e8%83%8c%e6%99%af%e4%b8%ba%e4%bb%80%e4%b9%88%e9%9c%80%e8%a6%81%e6%9b%bf%e4%bb%a3%e5%93%81" class="header-mark"></a>背景：为什么需要替代品</h2><p>长期以来，Anaconda Distribution 和 Miniconda 是 Python 数据科学与科学计算场景下最常用的发行版。然而自 2020 年起，Anaconda, Inc. 更新了其服务条款（Terms of Service）,对商业用途做出了限制:</p>]]></description></item><item><title>Gin 开发后台服务最佳实践</title><link>https://rd163.visword.com/posts/best-practice-for-gin/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/best-practice-for-gin/</guid><description><![CDATA[<p><a href="https://github.com/gin-gonic/gin" target="_blank" rel="noopener noreferrer">gin</a> 是一个由 Go 语言实现的 HTTP Web 框架，基于 httprouter，主打高性能与简洁的 API 设计，常用于构建 REST API 与微服务。</p>
<p><a href="https://github.com/skyhee/gin-doc-cn" target="_blank" rel="noopener noreferrer">gin 中文文档</a> 系统介绍了路由、无缝重启、中间件、数据库接入等常用方法，可作为入门与速查参考。</p>]]></description></item><item><title>Go 语言 Web 框架：Macaron</title><link>https://rd163.visword.com/posts/golang-macaron/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-macaron/</guid><description><![CDATA[<p><a href="https://github.com/go-macaron/macaron" target="_blank" rel="noopener noreferrer">Macaron</a> 是一个用 Go 语言编写的高效、模块化 Web 框架，官方仓库自我定位为「a high productive and modular web framework in Go」。它与 Gin、Beego、Echo 等同属 Go 生态中较早期出现的一批 Web 框架，设计思路继承自 <a href="https://github.com/go-martini/martini" target="_blank" rel="noopener noreferrer">Martini</a>,底层依赖 <a href="https://github.com/codegangsta/inject" target="_blank" rel="noopener noreferrer">codegangsta/inject</a> 实现依赖注入，但在路由层做了重写，显著降低了反射开销与内存占用。详细的中文文档可参考:</p>]]></description></item><item><title>Golang web框架</title><link>https://rd163.visword.com/posts/golang-web-framework/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-web-framework/</guid><description><![CDATA[<h2 id="fiber" class="headerLink">
    <a href="#fiber" class="header-mark"></a>Fiber</h2><ul>
<li><a href="https://github.com/gofiber/fiber" target="_blank" rel="noopener noreferrer">Fiber</a>:受 Express.js 启发的 Go Web 框架，底层基于 fasthttp，主打零内存分配与高性能。</li>
</ul>
<p>基于 Fiber 的开源项目:</p>
<ul>
<li><a href="https://github.com/Finb/bark-server" target="_blank" rel="noopener noreferrer">bark-server</a>:iOS 推送通知服务 Bark 的后端。</li>
</ul>
<h2 id="macaron" class="headerLink">
    <a href="#macaron" class="header-mark"></a>Macaron</h2><ul>
<li><a href="https://github.com/go-macaron/macaron" target="_blank" rel="noopener noreferrer">Macaron</a>:高生产力、模块化的 Go Web 框架。目前已进入维护模式，不再新增功能，官方推荐其后继者 <a href="https://github.com/flamego/flamego" target="_blank" rel="noopener noreferrer">Flamego</a>。</li>
</ul>
<h2 id="beego" class="headerLink">
    <a href="#beego" class="header-mark"></a>Beego</h2><ul>
<li><a href="https://github.com/beego/beego" target="_blank" rel="noopener noreferrer">Beego</a>:老牌高性能 Go Web 框架，提供 ORM、缓存、日志、配置、任务等一整套模块。注：原作者仓库 <code>astaxie/beego</code> 已迁移至 <code>beego/beego</code> 组织，请使用新地址。</li>
</ul>
<h2 id="gin" class="headerLink">
    <a href="#gin" class="header-mark"></a>Gin</h2><ul>
<li><a href="https://github.com/gin-gonic/gin" target="_blank" rel="noopener noreferrer">Gin</a>:使用最广泛的 Go Web 框架，采用 httprouter 改造的路由，性能高、API 简洁，中间件生态丰富。</li>
</ul>
<h2 id="echo" class="headerLink">
    <a href="#echo" class="header-mark"></a>Echo</h2><ul>
<li><a href="https://github.com/labstack/echo" target="_blank" rel="noopener noreferrer">Echo</a>:高性能、极简的 Go Web 框架，自动 TLS、HTTP/2、可扩展中间件支持完善。</li>
</ul>
<h2 id="chi" class="headerLink">
    <a href="#chi" class="header-mark"></a>Chi</h2><ul>
<li><a href="https://github.com/go-chi/chi" target="_blank" rel="noopener noreferrer">chi</a>:轻量、兼容 <code>net/http</code> 的路由库，API 与标准库无缝衔接，适合构建可组合的 HTTP 服务。</li>
</ul>
<h2 id="gorilla" class="headerLink">
    <a href="#gorilla" class="header-mark"></a>Gorilla</h2><ul>
<li><a href="https://github.com/gorilla/mux" target="_blank" rel="noopener noreferrer">gorilla/mux</a>:强大的 HTTP 路由与请求匹配器，功能丰富。Gorilla 工具集曾在 2022 年底被归档，后由新的维护者团队接管并恢复维护。</li>
<li><a href="https://github.com/gorilla/websocket" target="_blank" rel="noopener noreferrer">gorilla/websocket</a>:Go 社区应用最广泛的 WebSocket 库。</li>
</ul>
<h2 id="fasthttp" class="headerLink">
    <a href="#fasthttp" class="header-mark"></a>fasthttp</h2><ul>
<li><a href="https://github.com/valyala/fasthttp" target="_blank" rel="noopener noreferrer">fasthttp</a>:为极端性能优化的 HTTP 实现，吞吐量与内存占用均显著优于标准库 <code>net/http</code>,但 API 与 <code>net/http</code> 不兼容。</li>
</ul>
<h2 id="httprouter" class="headerLink">
    <a href="#httprouter" class="header-mark"></a>httprouter</h2><ul>
<li><a href="https://github.com/julienschmidt/httprouter" target="_blank" rel="noopener noreferrer">httprouter</a>:基于 radix tree 的高性能路由，是众多 Go Web 框架（含 Gin）的底层路由原型。</li>
</ul>
<h2 id="hertz" class="headerLink">
    <a href="#hertz" class="header-mark"></a>Hertz</h2><p>Hertz(发音 [həːts],赫兹)是字节跳动开源的 Golang 微服务 HTTP 框架，由 <a href="https://github.com/cloudwego" target="_blank" rel="noopener noreferrer">CloudWeGo</a> 社区维护。它最初 fork 自 fasthttp，在设计上参考了 Gin、Echo 等开源框架的优势，并结合字节跳动内部对高性能与可扩展性的诉求进行了重构与演进。其默认网络库使用 CloudWeGo 自研的 <a href="https://github.com/cloudwego/netpoll" target="_blank" rel="noopener noreferrer">Netpoll</a>(基于 epoll),并保留了切换至 Go 标准网络库的能力，具有高易用性、高性能、高扩展性等特点，目前在字节跳动内部已大规模使用。</p>]]></description></item><item><title>Golang 常用的工具与功能库</title><link>https://rd163.visword.com/posts/golang-util-libs/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-util-libs/</guid><description>&lt;p>Go 标准库覆盖面相当广，但工程实践中仍有许多「写起来啰嗦、但又避不开」的常见需求：类型之间的安全转换、切片去重、字符串处理、优雅重启、后台任务编排、网络报文解析等。本文梳理几款在 Go 项目里出现频率较高的工具与功能库，介绍其定位、核心特性和维护状态，便于选型时参考。所有库均在 GitHub 上开源，文末附官方链接。&lt;/p></description></item><item><title>Golang 常用日志库</title><link>https://rd163.visword.com/posts/golang-log-libs/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-log-libs/</guid><description><![CDATA[<p>日志是服务可观测性的基石。Go 生态中,日志库大致经历了「标准库 <code>log</code> → 第三方结构化日志库(<code>logrus</code>、<code>zap</code>、<code>zerolog</code>) → 标准库 <code>log/slog</code>」三个阶段。本文梳理几款在工程中常见的 Go 日志库,介绍其定位、特性与基础用法,便于在实际选型时参考。</p>]]></description></item><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><item><title>Golang 服务相关的库</title><link>https://rd163.visword.com/posts/golang-service-libs/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-service-libs/</guid><description><![CDATA[<p>在构建后端服务时，Go 生态提供了从轻量 Web 框架到完整微服务框架的多层选择。相比单纯的路由库(如 <code>chi</code>、<code>gorilla/mux</code>)或高性能 HTTP 库(如 <code>fasthttp</code>),「服务级」框架通常还承担了 RPC 通信、服务治理、代码生成、配置管理等工程化职责。本文集中梳理几款在生产环境广泛使用的 Go 服务端框架与工具，便于在选型时横向对照。</p>]]></description></item></channel></rss>