Last active
September 12, 2015 02:51
-
-
Save shazow/c61a1832d55b5bd9dd9e to your computer and use it in GitHub Desktop.
Snippets for a blog post: Neither self nor this: Receivers in Go
This file contains 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
type Person struct { | |
Name string | |
} | |
func (person Person) Talk(out io.Writer) { | |
fmt.Fprintf("Hello, I am %s", person.Name) | |
} |
This file contains 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
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