test: improve reliability of file operations
- Add error handling after writing to a file in `local_file_test.go` test function Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
acf41a9a1a
commit
e3221e7a7a
|
@ -18,7 +18,10 @@ func TestLocalFile(t *testing.T) {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
defer os.Remove(f.Name())
|
defer os.Remove(f.Name())
|
||||||
f.WriteString("Gin Web Framework")
|
_, err = f.WriteString("Gin Web Framework")
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
dir, filename := filepath.Split(f.Name())
|
dir, filename := filepath.Split(f.Name())
|
||||||
|
|
Loading…
Reference in New Issue