Slide 6
Slide 6 text
Automatic Dereference of
Pointers to Structs
Since g is a pointer, we should use
*g dereferencing syntax, like this
(*g).Title , to get the struct field
value.
But Go allows us to access the fields
of a struct pointer without
dereferencing it, using the simplest
syntax g.Title
Go will take care of dereferencing
a pointer under the hood
Try It!
6 / 9
Pointers in Go
Luca Sepe
Software Craftsman, Solution Architect, Trainer
https://twitter.com/lucasepe/
https://github.com/lucasepe/
https://lucasepe.it/