From a5938c32e9459b2627fcbbc9a7792ef90264978e Mon Sep 17 00:00:00 2001 From: MaurĂ­cio Antunes Date: Tue, 6 Dec 2022 20:54:55 -0300 Subject: feat: add two struct exercises --- exercises/structs/structs2/main.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 exercises/structs/structs2/main.go (limited to 'exercises/structs/structs2') 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) +} -- cgit v1.2.3-70-g09d2