Last active
August 6, 2021 11:37
-
-
Save percybolmer/3cc03a9ff2fe4c76295092c897e07421 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NewNetworkPayload is used to convert a regular payload into a network payload | |
func NewNetworkPayload(pay Payload) (*NetworkPayload, error) { | |
conv, ok := pay.(*NetworkPayload) | |
if ok { | |
return conv, nil | |
} | |
return nil, ErrPayloadIsNotANetworkPayload | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment