filesystem

package
v0.0.0-...-8a24156 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL