Skip to content

Instantly share code, notes, and snippets.

@shazow
Last active September 12, 2015 02:51
Show Gist options
  • Save shazow/c61a1832d55b5bd9dd9e to your computer and use it in GitHub Desktop.
Save shazow/c61a1832d55b5bd9dd9e to your computer and use it in GitHub Desktop.
Snippets for a blog post: Neither self nor this: Receivers in Go
type Person struct {
Name string
}
func (person Person) Talk(out io.Writer) {
fmt.Fprintf("Hello, I am %s", person.Name)
}
type Person struct {
Name string
}
func (self Person) Talk(out io.Writer) {
fmt.Fprintf("Hello, I am %s", self.Name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment