Implemented runes

This commit is contained in:
Eduard Urbach 2024-07-22 15:32:16 +02:00
parent eaeeba495e
commit f7645104fb
Signed by: eduard
GPG key ID: 49226B848C78F6C8
11 changed files with 88 additions and 27 deletions

View file

@ -0,0 +1,15 @@
package errors
import "fmt"
// NumberExceedsBounds error is created when the number doesn't fit into the destination.
type NumberExceedsBounds struct {
Number int
Size byte
ExpectedSize byte
}
// Error generates the string representation.
func (err *NumberExceedsBounds) Error() string {
return fmt.Sprintf("Number %d needs %d bytes but the maximum is %d bytes", err.Number, err.Size, err.ExpectedSize)
}