Define a Go struct using the type keyword followed by the struct name and a block of named fields with their types.
Define a struct using the type keyword, followed by the struct name, the struct keyword, and a block containing field names and their types.
type Int struct {
i C.mpz_t
init bool
}
This creates a new composite type named Int with two fields: i of type C.mpz_t and init of type bool.
A struct is a custom container that groups different pieces of data together under one name. Think of it like a form with labeled boxes where each box holds a specific type of information. You use structs to organize related data, such as the i and init fields in the Int example, so you can treat them as a single unit.