We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os.Close
Calling os.Close on an io.Closer may return an error, and ignoring the same might result in a data loss.
io.Closer
There are 3 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/ZeStream/zestream-server/issue/GO-S2307/occurrences/
package main import ( "fmt" "os" ) func foo() error { f, err := os.Create("/tmp/test.txt") if err != nil { return err } defer f.Close() return fmt.Fprint(f, "Hello World") }
package main import ( "fmt" "os" ) func foo() error { f, err := os.Create("/tmp/test.txt") if err != nil { return err } err = fmt.Fprint(f, "Hello World") if err != nil { return err } return f.Close() }
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() }
The text was updated successfully, but these errors were encountered:
I am working on this @uzaxirr @abhishekraj272. I have recently started learning Go and using this repo to learn simultaneously!
Sorry, something went wrong.
No branches or pull requests
Description
Calling
os.Close
on anio.Closer
may return an error, and ignoring the same might result in a data loss.Occurrences
There are 3 occurrences of this issue in the repository.
See all occurrences on DeepSource → deepsource.io/gh/ZeStream/zestream-server/issue/GO-S2307/occurrences/

Suggestions
Bad Practice
Recommend
The text was updated successfully, but these errors were encountered: