diff options
| author | Shulhan <ms@kilabit.info> | 2021-10-09 15:53:47 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-10-09 22:22:01 +0700 |
| commit | 1c522de25c47d1fa1bfdf56ad52e1977bb1f8c9f (patch) | |
| tree | add9b08a8dd901f3e6888861999dc072a4e97393 /lib/memfs/memfs_test.go | |
| parent | fe8de830213b16cbd9b584a8c869597a6f216224 (diff) | |
| download | pakakeh.go-1c522de25c47d1fa1bfdf56ad52e1977bb1f8c9f.tar.xz | |
lib/memfs: simplify createRoot and scanDir
The createRoot should not open the file, only call to os.Stat.
The scanDir should only accept the node to be scanned and the call to
Open and Close should be inside the method of scanDir not outside of it.
While at it, prefix all returned errors with method names.
Diffstat (limited to 'lib/memfs/memfs_test.go')
| -rw-r--r-- | lib/memfs/memfs_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/memfs/memfs_test.go b/lib/memfs/memfs_test.go index 83d78bb7..50be993c 100644 --- a/lib/memfs/memfs_test.go +++ b/lib/memfs/memfs_test.go @@ -66,7 +66,7 @@ func TestNew(t *testing.T) { opts: Options{ Root: afile, }, - expErr: fmt.Sprintf("memfs.New: mount: %q must be a directory", afile), + expErr: fmt.Sprintf("memfs.New: mount: createRoot %s: must be a directory", afile), }, { desc: "With directory", opts: Options{ |
