Skip to content

Instantly share code, notes, and snippets.

@jjuliano
Last active December 16, 2019 11:07
Show Gist options
  • Save jjuliano/7b4a7a184719782138e7bd290b79ee92 to your computer and use it in GitHub Desktop.
Save jjuliano/7b4a7a184719782138e7bd290b79ee92 to your computer and use it in GitHub Desktop.
func (receiverName *receiverType) functionName(parameterName parameterType) {
// we can directly set the value of the receiver type (setter)
*receiverName = parameterName
// we can also access the value of the receiver type (getter)
fmt.Println(receiverName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment