-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
docs: fix some comments errors #2391
Conversation
sysvm
commented
Jun 24, 2023
•
edited
Loading
edited
- fix some comments errors such as: misspelling, syntax error and so on.
- extract a string const.
39571d2
to
38e0e92
Compare
examples/multipro/node.go
Outdated
// data: common p2p message data | ||
func (n *Node) authenticateMessage(message proto.Message, data *p2p.MessageData) bool { | ||
// store a temp ref to signature and remove it from message data | ||
// sign is a string to allow easy reset to zero-value (empty string) | ||
sign := data.Sign | ||
data.Sign = nil | ||
|
||
// marshall data without the signature to protobufs3 binary format | ||
// marshall data without the signature to protobuf binary format |
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.
haven't looked but if it's actually marshaling to proto3 we may want to keep that distinction
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.
fixed
@@ -31,7 +31,7 @@ func expectHeader(r *bufio.Reader, expected []byte) error { | |||
return err | |||
} | |||
if !bytes.Equal(header, expected) { | |||
return fmt.Errorf("expected file header %s, got: %s", pathPSKv1, header) | |||
return fmt.Errorf("expected file header %s, got: %s", expected, header) |
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.
Makes sense to change this to expected but I am not the expert here, cc @marten-seemann
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.
Yes, this is correct, although in practice it doesn't make any difference, since this function is only called once with expected = pathPSKv1
.
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