Skip to content

Commit e3221e7

Browse files
committed
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 <[email protected]>
1 parent acf41a9 commit e3221e7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

local_file_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ func TestLocalFile(t *testing.T) {
1818
t.Error(err)
1919
}
2020
defer os.Remove(f.Name())
21-
f.WriteString("Gin Web Framework")
21+
_, err = f.WriteString("Gin Web Framework")
22+
if err != nil {
23+
t.Error(err)
24+
}
2225
f.Close()
2326

2427
dir, filename := filepath.Split(f.Name())

0 commit comments

Comments
 (0)