@@ -18,17 +18,17 @@ func getTempFiles() (tempFiles []string) {
18
18
19
19
func createTempFiles (tmpDir string ) {
20
20
for _ , file := range getTempFiles () {
21
- filename := fmt .Sprintf ("%s%s" , tmpDir , file )
21
+ filename := fmt .Sprintf ("%s/ %s" , tmpDir , file )
22
22
_ , err := os .Create (filename )
23
23
if err != nil {
24
- log .Fatalf ("Failed to create file: %s" , file )
24
+ log .Fatalf ("Failed to create file: %s" , filename )
25
25
}
26
26
}
27
27
}
28
28
29
29
func removeTempFiles (tmpDir string ) {
30
30
for _ , file := range getTempFiles () {
31
- filename := fmt .Sprintf ("%s%s" , tmpDir , file )
31
+ filename := fmt .Sprintf ("%s/ %s" , tmpDir , file )
32
32
f , err := os .Open (filename )
33
33
check (err , "Failed to open file" )
34
34
f .Close ()
@@ -45,10 +45,10 @@ func TestGetFiles(t *testing.T) {
45
45
createTempFiles (tmpDir )
46
46
47
47
want := []string {
48
- fmt .Sprintf ("%s2024 .json" , tmpDir ),
49
- fmt .Sprintf ("%s2023 .json" , tmpDir ),
50
- fmt .Sprintf ("%s2022 .json" , tmpDir ),
51
- fmt .Sprintf ("%s2021 .json" , tmpDir ),
48
+ fmt .Sprintf ("%s/2024 .json" , tmpDir ),
49
+ fmt .Sprintf ("%s/2023 .json" , tmpDir ),
50
+ fmt .Sprintf ("%s/2022 .json" , tmpDir ),
51
+ fmt .Sprintf ("%s/2021 .json" , tmpDir ),
52
52
}
53
53
got := getFiles ("json" , tmpDir )
54
54
if len (got ) != len (want ) {
0 commit comments