published: 24th of November 2019
A Structure or struct for short, is a type defined by the user that stores a collection of fields.
// create a struct
type stuffAndThings struct {
stuff string
things string
}
// Instantiate a struct
st := stuffAndThings{
stuff: "stuff",
things: "things",
}
// Use the dot (.) operator to access struct fields
st.stuff
st.things