From 69002914e76a129d2b3cd556222261b639a37759 Mon Sep 17 00:00:00 2001 From: Francisco Imanol Suarez Date: Tue, 26 Oct 2021 18:40:25 +0000 Subject: [PATCH] add struct example --- examples/struct.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 examples/struct.txt diff --git a/examples/struct.txt b/examples/struct.txt new file mode 100644 index 0000000..22f6c60 --- /dev/null +++ b/examples/struct.txt @@ -0,0 +1,14 @@ +package main + +import "fmt" + +type Person struct { + FirstName string + LastName string +} + +func main() { + john := Person{FirstName: "John", LastName: "Doe"} + fmt.Println(john) + fmt.Println(john.FirstName) +}