diff --git a/util/afero.go b/util/afero.go index 7dae15c5..8d220a32 100644 --- a/util/afero.go +++ b/util/afero.go @@ -29,6 +29,9 @@ import ( // FsTree returns a string representation of the file system tree similar to the // well-known `tree` command. func FsTree(fs afero.Fs, name string) (string, error) { + if fs == nil { + return "", fmt.Errorf("nil fs") + } clean := path.Clean(name) str := clean + "/\n" // named dir if name == "" {