Created
November 5, 2019 09:42
-
-
Save kjk/6c730ba2eae313952f1e5409e0fa7321 to your computer and use it in GitHub Desktop.
Methods
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
// :collection Essential Go | |
package main | |
import "fmt" | |
// :show start | |
type Person struct { | |
FirstName string | |
LastName string | |
} | |
func (p *Person) PrintFullName() { | |
fmt.Printf("%s %s\n", p.FirstName, p.LastName) | |
} | |
func main() { | |
p := &Person{ | |
"John", | |
"Doe", | |
} | |
p.PrintFullName() | |
} | |
// :show end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment