Skip to content

Conversation

@ermyar
Copy link
Collaborator

@ermyar ermyar commented Nov 29, 2025

Tests and methods are updated with enabling errcheck for golangci-lint check.

Closes #334

I didn't forget about (remove if it is not applicable):

Copy link
Collaborator

@oleg-jukovec oleg-jukovec left a 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.

@ermyar ermyar force-pushed the ermyar/gh-334-enabling-linter-errcheck branch from a423cbc to 8a2d56f Compare December 3, 2025 18:16
@ermyar ermyar requested a review from oleg-jukovec December 3, 2025 19:56
Copy link
Collaborator

@oleg-jukovec oleg-jukovec left a 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.
Copy link
Collaborator

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
Comment on lines 15 to 23
_ = 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))
Copy link
Collaborator

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.

b.ResetTimer()
for n := 0; n < b.N; n++ {
EncodeStringToBCD(testcase.numString)
_, _ = EncodeStringToBCD(testcase.numString)
Copy link
Collaborator

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.

b.ResetTimer()
for n := 0; n < b.N; n++ {
DecodeStringFromBCD(bcdBuf)
_, _, _ = DecodeStringFromBCD(bcdBuf)
Copy link
Collaborator

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.

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Dec 5, 2025

Please, change the link to the issue:

Fixes #334 -> Closes #334

Tests and methods are updated with enabling `errcheck`
for `golangci-lint` check.

Closes #334
@ermyar ermyar force-pushed the ermyar/gh-334-enabling-linter-errcheck branch from 8a2d56f to 5959070 Compare December 5, 2025 13:58
@ermyar ermyar requested a review from oleg-jukovec December 5, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lint: enable errcheck

3 participants