@@ -57,27 +57,27 @@ func TestLocalStorageIterator(t *testing.T) {
57
57
l , err := NewLocalStorage (context .Background (), LocalStorageConfig {Path : "testdata/" })
58
58
assert .NoError (t , err )
59
59
60
- test_files := [][]string {
60
+ testFiles := [][]string {
61
61
{"a/1.txt" , "a1" },
62
62
{"/a/1.txt" , "aa1" }, // same as above, but with leading slash that will be trim
63
63
{"b/1.txt" , "b1" },
64
64
{"b/2.txt" , "b2" },
65
65
{"b/3.txt" , "b3" },
66
66
{"b/x 4.txt" , "bx4" },
67
67
}
68
- for _ , f := range test_files {
68
+ for _ , f := range testFiles {
69
69
_ , err = l .Save (f [0 ], bytes .NewBufferString (f [1 ]), - 1 )
70
70
assert .NoError (t , err )
71
71
}
72
72
73
- expected_list := map [string ][]string {
73
+ expectedList := map [string ][]string {
74
74
"a" : {"a/1.txt" },
75
75
"b" : {"b/1.txt" , "b/2.txt" , "b/3.txt" , "b/x 4.txt" },
76
76
"" : {"a/1.txt" , "b/1.txt" , "b/2.txt" , "b/3.txt" , "b/x 4.txt" },
77
77
"/" : {"a/1.txt" , "b/1.txt" , "b/2.txt" , "b/3.txt" , "b/x 4.txt" },
78
78
"a/b/../../a" : {"a/1.txt" },
79
79
}
80
- for dir , expected := range expected_list {
80
+ for dir , expected := range expectedList {
81
81
count := 0
82
82
err = l .IterateObjects (dir , func (path string , f Object ) error {
83
83
defer f .Close ()
@@ -90,12 +90,12 @@ func TestLocalStorageIterator(t *testing.T) {
90
90
}
91
91
92
92
// illegal dir
93
- illegal_dirs := []string {
93
+ illegalDirs := []string {
94
94
"../a" ,
95
95
"../../etc/hosts" ,
96
96
"../a/../b" ,
97
97
}
98
- for _ , dir := range illegal_dirs {
98
+ for _ , dir := range illegalDirs {
99
99
err = l .IterateObjects (dir , func (path string , f Object ) error {
100
100
defer f .Close ()
101
101
return nil
0 commit comments