aboutsummaryrefslogtreecommitdiff
path: root/lib/memfs/memfs_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-03-06 03:06:54 +0700
committerShulhan <ms@kilabit.info>2024-03-06 03:06:54 +0700
commit1e7cb99f42bcd41e98326bd9406d3cecfb2a4542 (patch)
tree9981f1ebc98670f516939374012646314dda663f /lib/memfs/memfs_test.go
parent16607dc13477ee53d95ee0295192643f6e726652 (diff)
downloadpakakeh.go-1e7cb99f42bcd41e98326bd9406d3cecfb2a4542.tar.xz
all: conform with linter gosec, ineffasign, and makezero
Some of warnings from those linter are false positives, so we just annotated them.
Diffstat (limited to 'lib/memfs/memfs_test.go')
-rw-r--r--lib/memfs/memfs_test.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/memfs/memfs_test.go b/lib/memfs/memfs_test.go
index e6dffb0a..3c0f3f5e 100644
--- a/lib/memfs/memfs_test.go
+++ b/lib/memfs/memfs_test.go
@@ -58,14 +58,16 @@ func TestMain(m *testing.M) {
}
func TestNew(t *testing.T) {
- afile := filepath.Join(_testWD, "testdata/index.html")
-
- cases := []struct {
+ type testCase struct {
desc string
expErr string
expMapKeys []string
opts Options
- }{{
+ }
+
+ var afile = filepath.Join(_testWD, `testdata/index.html`)
+
+ var listCase = []testCase{{
desc: "With empty dir",
expErr: "open : no such file or directory",
}, {
@@ -152,10 +154,11 @@ func TestNew(t *testing.T) {
}}
var (
+ c testCase
mfs *MemFS
err error
)
- for _, c := range cases {
+ for _, c = range listCase {
t.Log(c.desc)
mfs, err = New(&c.opts)