diff options
author | MaurĂcio Antunes <mauricio.abreua@gmail.com> | 2022-12-06 20:54:55 -0300 |
---|---|---|
committer | MaurĂcio Antunes <mauricio.abreua@gmail.com> | 2022-12-06 20:54:55 -0300 |
commit | a5938c32e9459b2627fcbbc9a7792ef90264978e (patch) | |
tree | 4986415f2c5d0cb0ca40dda57871823ca741c47e /exercises/structs/structs2/main.go | |
parent | 9d3193a997a55219522d992007b1ae40739e4295 (diff) |
feat: add two struct exercises
Diffstat (limited to 'exercises/structs/structs2/main.go')
-rw-r--r-- | exercises/structs/structs2/main.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/exercises/structs/structs2/main.go b/exercises/structs/structs2/main.go new file mode 100644 index 0000000..80e7dce --- /dev/null +++ b/exercises/structs/structs2/main.go @@ -0,0 +1,19 @@ +// structs2 +// Make me compile! +// +// I AM NOT DONE +package main + +import "fmt" + +type Person struct { + // don't just create the phone field here. embed a new struct + name string + age int +} + +func main() { + // contactDetails := ContactDetails{} + person := Person{name: "John", age: 32} + fmt.Printf("%s is %d years old and his phone is %s\n", person.name, person.age, person.phone) +} |