Skip to content

Instantly share code, notes, and snippets.

@donvito
Last active May 21, 2018 14:33
Show Gist options
  • Save donvito/acd6689c820be2c43ca4f2bed8bba524 to your computer and use it in GitHub Desktop.
Save donvito/acd6689c820be2c43ca4f2bed8bba524 to your computer and use it in GitHub Desktop.
Sample application used for debugging with delve
package main
/*Person is a struct type*/
type Person struct {
Name string
Age int
}
func main() {
var me Person
me.Name = "Melvin"
me.Age = 41
var wife Person
wife.Name = "Raye"
wife.Age = 36
var daughter Person
daughter.Name = "Katherina"
daughter.Age = 5
var son Person
son.Name = "Vito"
son.Age = 2
var family []Person
family = append(family, me, wife, daughter, son)
birthdayToday(&daughter)
}
func birthdayToday(person *Person) {
person.Age = person.Age + 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment