-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add more helper functions for RelayMessageOption. #12
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.
Add some tests too please.
@@ -294,3 +294,25 @@ func (r *RelayMessageOption) SetRelayMessage(p *RelayMessage) error { | |||
*r = b | |||
return nil | |||
} | |||
|
|||
// Get Client Server Message (e.g. Solicit Advertise ...) into this option (when hopcount = 0 of outer RelayMessage) | |||
func (r *RelayMessageOption) GetClientServerMessage() (*Packet, error) { |
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.
Get
isn't really idiomatic in Go. How about just ClientServerMessage
?
} | ||
|
||
// Get RelayMessage (e.g. Relay Forward, Relay Reply) into this option (when hopcount > 0 of outer RelayMessage) | ||
func (r *RelayMessageOption) GetRelayMessage() (*RelayMessage, error) { |
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.
Get
isn't really idiomatic in Go. How about just RelayMessage
?
@@ -294,3 +294,25 @@ func (r *RelayMessageOption) SetRelayMessage(p *RelayMessage) error { | |||
*r = b | |||
return nil | |||
} | |||
|
|||
// Get Client Server Message (e.g. Solicit Advertise ...) into this option (when hopcount = 0 of outer RelayMessage) |
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.
Name this the same as the function.
Add commas between the message types you're listing.
Break to newline after 80 characters.
Add a period.
return p, nil | ||
} | ||
|
||
// Get RelayMessage (e.g. Relay Forward, Relay Reply) into this option (when hopcount > 0 of outer RelayMessage) |
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.
Name this the same as the function.
Add commas between the message types you're listing.
Break to newline after 80 characters.
Add a period.
This PR is for adding more helper function for RelayMessageOption.