Skip to content
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

Merged
merged 1 commit into from
Oct 6, 2016
Merged

Add more helper functions for RelayMessageOption. #12

merged 1 commit into from
Oct 6, 2016

Conversation

jerome-laforge
Copy link
Contributor

This PR is for adding more helper function for RelayMessageOption.

Copy link
Owner

@mdlayher mdlayher left a 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) {
Copy link
Owner

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) {
Copy link
Owner

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)
Copy link
Owner

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)
Copy link
Owner

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.

@mdlayher mdlayher merged commit 74e4e92 into mdlayher:master Oct 6, 2016
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.

None yet

2 participants