TUN-8407: Upgrade go to version 1.22.2

This commit is contained in:
João "Pisco" Fernandes
2024-05-07 11:19:58 +01:00
parent f27418044b
commit 66efd3f2bb
412 changed files with 28140 additions and 17395 deletions

View File

@@ -87,3 +87,18 @@ func InvalidUTF8(name string) error {
func RequiredNotSet(name string) error {
return New("required field %v not set", name)
}
type SizeMismatchError struct {
Calculated, Measured int
}
func (e *SizeMismatchError) Error() string {
return fmt.Sprintf("size mismatch (see https://github.com/golang/protobuf/issues/1609): calculated=%d, measured=%d", e.Calculated, e.Measured)
}
func MismatchedSizeCalculation(calculated, measured int) error {
return &SizeMismatchError{
Calculated: calculated,
Measured: measured,
}
}