Last active
May 21, 2018 14:33
-
-
Save donvito/acd6689c820be2c43ca4f2bed8bba524 to your computer and use it in GitHub Desktop.
Sample application used for debugging with delve
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
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