-
Notifications
You must be signed in to change notification settings - Fork 160
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
MAC: Avoid always-nil error #2602
Conversation
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.
Reviewed 9 of 9 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @oncilla)
go/lib/spath/hop.go, line 155 at r1 (raw file):
mac.Reset() // We can safely ignore the return values: https://godoc.org/hash#Hash mac.Write(all)
I would add a panic if the Write
returns an error; it would catch faulty implementations of hash.Hash
.
1638197
to
d6e433f
Compare
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.
Reviewable status: 7 of 9 files reviewed, 1 unresolved discussion (waiting on @scrye)
go/lib/spath/hop.go, line 155 at r1 (raw file):
Previously, scrye (Sergiu Costea) wrote…
I would add a panic if the
Write
returns an error; it would catch faulty implementations ofhash.Hash
.
Done.
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.
Reviewed 2 of 3 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
The `spat.Hop.CalcMac` unecessarily returns an error. It is always nil. This PR removes the error from the returned values and reduces the error handling branches in the code.
d6e433f
to
5fe289f
Compare
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.
Reviewed 1 of 2 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
The
spath.Hop.CalcMac
unnecessarily returns an error. It is always nil.This PR removes the error from the returned values and reduces the
error handling branches in the code.
This change is