main: Mock file system and add getFile tests

This uses afero to proxy all file system accesses and then injects an
in-memory file system in order to test the getFile function.
This commit is contained in:
Johannes Marbach
2021-12-30 14:25:37 +01:00
parent 206e75c597
commit 91529b736e
4 changed files with 603 additions and 26 deletions

1
go.mod
View File

@@ -6,5 +6,6 @@ require (
github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e
github.com/klauspost/compress v1.13.3 // indirect
github.com/klauspost/pgzip v1.2.5
github.com/spf13/afero v1.7.1
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
)