In Go, we use structs to define and group , as we would use classes in other OOP languages. However, in Go the naming of attributes within the is important because if it starts with a lower-case it’s seen as private and with an upper-case first letter it’s seen as public.
We can encode these structs into data formats like json but we might want to rename the fields, struct allow us to do this.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here