<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Modularity on Simple Enough Blog</title><link>https://blog-dev.simpleenough.net/tags/modularity/</link><description>Recent content in Modularity on Simple Enough Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 15 Dec 2025 10:08:49 +0200</lastBuildDate><atom:link href="https://blog-dev.simpleenough.net/tags/modularity/index.xml" rel="self" type="application/rss+xml"/><item><title>Interfaces, Functions and Modules in Go: Structuring Your Code for TDD Without Adding Unnecessary Complexity</title><link>https://blog-dev.simpleenough.net/blog/go-tdd-interfaces-functions/</link><pubDate>Mon, 15 Dec 2025 10:08:49 +0200</pubDate><guid>https://blog-dev.simpleenough.net/blog/go-tdd-interfaces-functions/</guid><description>&lt;h2 id="i-introduction" class="heading">I. Introduction&lt;a href="#i-introduction" aria-labelledby="i-introduction">
&lt;!-- &lt;i class="fas fa-link anchor">&lt;/i> -->
 &lt;svg class="svg-inline--fa fas fa-link anchor" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 640 512">&lt;use href="#fas-link">&lt;/use>&lt;/svg>&amp;nbsp;
 &lt;/a>
&lt;/h2>
&lt;p>Go is a minimalist language, but this simplicity can sometimes make developers feel like something is “missing” — especially when dealing with more advanced architectures, Test-Driven Development, or the need to mock dependencies. Developers coming from Java, C#, or Python often ask the same questions:&lt;/p>
&lt;ul>
&lt;li>&lt;em>Should I turn all my functions into structs + interfaces to test them?&lt;/em>&lt;/li>
&lt;li>&lt;em>How should I organize my packages to keep them modular and testable?&lt;/em>&lt;/li>
&lt;li>&lt;em>Where should interfaces live — in the provider or the consumer?&lt;/em>&lt;/li>
&lt;li>&lt;em>How do I isolate a package that only exports functions?&lt;/em>&lt;/li>
&lt;li>&lt;em>How does Go automatically detect signature changes?&lt;/em>&lt;/li>
&lt;/ul>
&lt;hr>




&lt;h2 id="ii-gos-model-simple-modular-but-different" class="heading">II. Go&amp;rsquo;s Model: Simple, Modular, but Different&lt;a href="#ii-gos-model-simple-modular-but-different" aria-labelledby="ii-gos-model-simple-modular-but-different">
&lt;!-- &lt;i class="fas fa-link anchor">&lt;/i> -->
 &lt;svg class="svg-inline--fa fas fa-link anchor" fill="currentColor" aria-hidden="true" role="img" viewBox="0 0 640 512">&lt;use href="#fas-link">&lt;/use>&lt;/svg>&amp;nbsp;
 &lt;/a>
&lt;/h2>
&lt;p>Unlike Java or C#, Go does not rely on inheritance, classes, or heavy dependency injection frameworks.&lt;/p></description></item></channel></rss>