Discover Packages
github.com/yardbirdsax/go-all-in
testing
filesystem
package
Version:
v0.0.0-...-8a24156
Opens a new window with list of versions in this module.
Published: Mar 2, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Testing things that work with filesystems
This section is all about how we can test things that interact with filesystems!
General principals
Rather than test against an actual filesystem, we want to test against something that mimics a
filesystem.
We should use dependency
injection to
write code that works both against a real filesystem or against something that looks like a
filesystem.
Libraries used
Notes
The way I did dependency injection isn't super idiomatic. Ideally I'd have a struct that has a field
of type afero.Fs
, then a method on the struct that does the appending, plus a wrapper method that
defaults the field with an afero.OsFs
for ease of use.
Expand ▾
Collapse ▴
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.