Skip to content

Commit 6e6360c

Browse files
committed
test: refactor tests and cleanup imports
- Replace `ioutil.TempFile` with `os.CreateTemp` in `TestEmptyDirectory` test function - Remove unused import `io/ioutil` in `serve_test.go` Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 9f124f7 commit 6e6360c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

serve_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package static
22

33
import (
44
"context"
5-
"io/ioutil"
65
"net/http"
76
"net/http/httptest"
87
"os"
@@ -23,9 +22,8 @@ func PerformRequest(r http.Handler, method, path string) *httptest.ResponseRecor
2322
}
2423

2524
func TestEmptyDirectory(t *testing.T) {
26-
// SETUP file
2725
testRoot, _ := os.Getwd()
28-
f, err := ioutil.TempFile(testRoot, "")
26+
f, err := os.CreateTemp(testRoot, "")
2927
if err != nil {
3028
t.Error(err)
3129
}

0 commit comments

Comments
 (0)