aboutsummaryrefslogtreecommitdiffstats
path: root/exercises/structs/structs2/main.go
diff options
context:
space:
mode:
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)
+}