diff options
-rw-r--r-- | exercises/structs/structs3/main.go | 17 | ||||
-rw-r--r-- | info.toml | 12 |
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 +} @@ -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" |