golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.55k stars 520 forks source link

tour: Structs information #1587

Open PythonCoderUnicorn opened 7 months ago

PythonCoderUnicorn commented 7 months ago

Context: https://go.dev/tour/moretypes/2

The page simply has "a Struct is a collection of fields".

Based on the information of a Go struct i have learned from other sources is:

type [Name] struct {
      [var name] type
      [var name] type
 }

One example that can help fellow newbies to the language is to have an example of a book or a beverage, as these structs are simple and allow themselves to be reused for further code examples.

It would be helpful to have more information on the page.