aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--exercises/structs/structs3/main.go17
-rw-r--r--info.toml12
2 files changed, 29 insertions, 0 deletions
diff --git a/exercises/structs/structs3/main.go b/exercises/structs/structs3/main.go
new file mode 100644
index 0000000..ce0d0f7
--- /dev/null
+++ b/exercises/structs/structs3/main.go
@@ -0,0 +1,17 @@
+// structs3
+// Make me compile!
+//
+// I AM NOT DONE
+package main
+
+import "fmt"
+
+type Person struct {
+ firstName string
+ lastName string
+}
+
+func main() {
+ person := Person{firstName: "MaurĂ­cio", lastName: "Antunes"}
+ fmt.Printf("Person full name is: %s\n", person.FullName()) // here it must output Person full name is: MaurĂ­cio Antunes
+}
diff --git a/info.toml b/info.toml
index 591bc9c..65a3a71 100644
--- a/info.toml
+++ b/info.toml
@@ -253,6 +253,18 @@ specify the full path to the field. But you can do if you want.
"""
[[exercises]]
+name = "structs3"
+path = "exercises/structs/structs3/main.go"
+mode = "compile"
+hint = """
+You can add a function to a struct by adding code similar to the one below:
+
+func (s *StructHere) doSomething() {
+
+}
+"""
+
+[[exercises]]
name = "anonymous_functions1"
path = "exercises/anonymous_functions/anonymous_functions1/main.go"
mode = "compile"