Created
October 11, 2015 04:45
-
-
Save glennblock/d9a8bdc3ad76113be8f1 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
package main | |
import "fmt" | |
type person struct { | |
name string | |
age int | |
} | |
func (p *person) birthday() { | |
p.age++ | |
} | |
func main() { | |
pers := person {"Glenn", 43} | |
pers.birthday() | |
fmt.Println(pers) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment