-
Notifications
You must be signed in to change notification settings - Fork 60
lint: enabled errcheck #506
New issue
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
base: master
Are you sure you want to change the base?
Conversation
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not just ignore errors everywhere, but handle the error if it appropriate.
a423cbc to
8a2d56f
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, a couple more comments.
CHANGELOG.md
Outdated
|
|
||
| * New types for MessagePack extensions compatible with go-option (#459). | ||
| * Added `box.MustNew` wrapper for `box.New` without an error (#448). | ||
| * Enabled `errcheck` in linter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is something about an internal implementation so we don't the changelog entry.
deadline_io.go
Outdated
| _ = d.c.SetWriteDeadline(time.Now().Add(d.to)) | ||
| } | ||
| n, err = d.c.Write(b) | ||
| return | ||
| } | ||
|
|
||
| func (d *deadlineIO) Read(b []byte) (n int, err error) { | ||
| if d.to > 0 { | ||
| d.c.SetReadDeadline(time.Now().Add(d.to)) | ||
| _ = d.c.SetReadDeadline(time.Now().Add(d.to)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to check the return value here too.
decimal/decimal_test.go
Outdated
| b.ResetTimer() | ||
| for n := 0; n < b.N; n++ { | ||
| EncodeStringToBCD(testcase.numString) | ||
| _, _ = EncodeStringToBCD(testcase.numString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have asserts of error == nil here too.
decimal/decimal_test.go
Outdated
| b.ResetTimer() | ||
| for n := 0; n < b.N; n++ { | ||
| DecodeStringFromBCD(bcdBuf) | ||
| _, _, _ = DecodeStringFromBCD(bcdBuf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have asserts of error == nil here too.
|
Please, change the link to the issue:
|
Tests and methods are updated with enabling `errcheck` for `golangci-lint` check. Closes #334
8a2d56f to
5959070
Compare
Tests and methods are updated with enabling
errcheckforgolangci-lintcheck.Closes #334
I didn't forget about (remove if it is not applicable):