[Go] Define a struct

Created on November 30, 2026

Use type and struct to declare a named struct. Put the field declarations inside the braces.

type StructName struct {
}

This example defines an empty struct named Animal.

type Animal struct {
}
Go