Attributes
Attributes attach compile-time validated metadata to declarations. They use bracket syntax and can be applied to functions, types, struct fields, and enum variants.
Any struct can be used as an attribute. Attributes are registered at init() and can be queried at runtime via the runtime package. This enables patterns like automatic route registration or ORM field mapping.
The MustUse builtin is handled by the compiler and errors if a return value is discarded.
Try it: Comment out the _ = validate() line to see the MustUse error.