Go's errors package supports comparing and inspecting errors while keeping caller behavior independent of exact error messages. errors.As reports whether an error can be assigned to a target type and, when successful, stores the matching value there. section 6.6.2
Parsing with recognizable errors
A money package can expose ErrInvalidDecimal and ErrTooLarge as typed domain errors. ParseDecimal wraps the underlying strconv.ParseInt failure with ErrInvalidDecimal, while callers can compare the resulting error without relying on its complete message.
