<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>SOLID on 编程心语</title>
		<link>https://www.ithome.me/tags/solid/</link>
		<description>Recent content in SOLID on 编程心语</description>
		<generator>Hugo</generator>
		<language>zh-CN</language>
		
		
		
		
			<lastBuildDate>Tue, 04 Aug 2026 14:59:27 +0800</lastBuildDate>
		
			<atom:link href="https://www.ithome.me/tags/solid/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>策略模式重构实战：用Go消除代码中泛滥的if-else</title>
				<link>https://www.ithome.me/post/2026/07/10/strategy-pattern-refactoring-in-go/</link>
				<pubDate>Fri, 10 Jul 2026 08:00:00 +0800</pubDate>
				<guid>https://www.ithome.me/post/2026/07/10/strategy-pattern-refactoring-in-go/</guid>
				<description>&lt;h2 id=&#34;你的-if-else-正在失控&#34;&gt;你的 if-else 正在失控&lt;/h2&gt;&#xA;&lt;p&gt;一个支付系统，最初只支持支付宝。产品说要加微信支付，你加了一个 &lt;code&gt;if&lt;/code&gt;。三个月后要加银联，又加了一个 &lt;code&gt;if&lt;/code&gt;。半年后要加 Apple Pay、Google Pay、虚拟货币……等你回过神来，支付路由函数已经变成了这样：&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
