<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>fs on Arrans Technical blog</title><link>https://arran4.github.io/blog/tags/fs/</link><description>Recent content in fs on Arrans Technical blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>technicalblog123@arran4.com (Arran Ubels)</managingEditor><webMaster>technicalblog123@arran4.com (Arran Ubels)</webMaster><copyright>Arran Ubels. This work is licensed under a &lt;a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License&lt;/a>.</copyright><lastBuildDate>Fri, 14 Aug 2026 02:27:49 +0000</lastBuildDate><atom:link href="https://arran4.github.io/blog/tags/fs/index.xml" rel="self" type="application/rss+xml"/><item><title>The `go test -update` Convention for Golden Files</title><link>https://arran4.github.io/blog/post/2026/034-golden-test-update-convention/</link><pubDate>Fri, 14 Aug 2026 02:27:49 +0000</pubDate><author>technicalblog123@arran4.com (Arran Ubels)</author><guid>https://arran4.github.io/blog/post/2026/034-golden-test-update-convention/</guid><description>go test ./... -update is a common golden-test update convention, but -update is not built into go test. The repository&amp;rsquo;s test code defines that flag and uses it to decide whether to compare against or overwrite .golden files.
A typical implementation looks like:
1var update = flag.Bool(&amp;#34;update&amp;#34;, false, &amp;#34;update golden files&amp;#34;) 2 3//go:embed testdata/example.golden 4var exampleGolden []byte 5 6func TestSomething(t *testing.T) { 7 got := generateOutput() 8 9 golden := &amp;#34;testdata/example.</description></item><item><title>Testing File Systems: How I use MockFS, MapFS, and SimpleFS in Go</title><link>https://arran4.github.io/blog/post/2026/033-testing-fs-with-mapfs-mockfs/</link><pubDate>Fri, 14 Aug 2026 00:00:58 +0000</pubDate><author>technicalblog123@arran4.com (Arran Ubels)</author><guid>https://arran4.github.io/blog/post/2026/033-testing-fs-with-mapfs-mockfs/</guid><description>When building tools in Go that interact heavily with the file system, having a solid strategy for testing those interactions is critical. Direct coupling to os functions like os.MkdirAll or os.WriteFile makes testing cumbersome and slow.
In this post, I want to detail how I approach this by designing minimal file system interfaces and using in-memory implementations like MapFS and MockFS for tests.
Why This Matters in the Era of Agentic Coding Before diving into the code, it&amp;rsquo;s worth highlighting why robust, abstract testing environments are becoming even more critical today.</description></item></channel></rss>