aboutsummaryrefslogtreecommitdiffstats
path: root/exercises/structs/structs2/main.go
diff options
context:
space:
mode:
authorMaurĂ­cio Antunes <mauricio.abreua@gmail.com>2022-12-06 20:54:55 -0300
committerMaurĂ­cio Antunes <mauricio.abreua@gmail.com>2022-12-06 20:54:55 -0300
commita5938c32e9459b2627fcbbc9a7792ef90264978e (patch)
tree4986415f2c5d0cb0ca40dda57871823ca741c47e /exercises/structs/structs2/main.go
parent9d3193a997a55219522d992007b1ae40739e4295 (diff)
feat: add two struct exercises
Diffstat (limited to 'exercises/structs/structs2/main.go')
-rw-r--r--exercises/structs/structs2/main.go19
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)
+}