Skip to content

Instantly share code, notes, and snippets.

@glennblock
Created October 11, 2015 04:45
Show Gist options
  • Save glennblock/d9a8bdc3ad76113be8f1 to your computer and use it in GitHub Desktop.
Save glennblock/d9a8bdc3ad76113be8f1 to your computer and use it in GitHub Desktop.
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