Open MindHunter86 opened 1 year ago
Used recommended practice. Not working ...
package main
import (
"fmt"
"os"
)
func foo() error {
f, err := os.Create("/tmp/test.txt")
if err != nil {
return err
}
defer f.Close()
err = fmt.Fprint(f, "Hello World")
if err != nil {
return err
}
return f.Sync()
}
Used recommended practice. Not working ...
package main import ( "fmt" "os" ) func foo() error { f, err := os.Create("/tmp/test.txt") if err != nil { return err } defer f.Close() err = fmt.Fprint(f, "Hello World") if err != nil { return err } return f.Sync() }
Same issue in #20
Description
Calling
os.Close
on anio.Closer
may return an error, and ignoring the same might result in a data loss.Occurrences
There is 1 occurrence of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/MindHunter86/aniliSeeder/issue/GO-S2307/occurrences/