add workflow
All checks were successful
Go Action / goaction (push) Successful in 1m3s
Go Action / goaction (pull_request) Successful in 41s

This commit is contained in:
andrey
2025-12-24 00:12:33 +03:00
parent 779818e067
commit 05ed4eb281
5 changed files with 75 additions and 30 deletions

View File

@@ -86,7 +86,7 @@ func Parse(in string) (Size, error) {
var err error
// The next character must be [0-9.]
if !(in[0] == '.' || '0' <= in[0] && in[0] <= '9') {
if in[0] != '.' && ('0' > in[0] || in[0] > '9') {
return 0, fmt.Errorf("%w %q", ErrInvalidSize, orig)
}
@@ -245,6 +245,7 @@ func leadingInt[bytes []byte | string](in bytes) (uint64, bytes, error) {
func (s Size) String() string {
var arr [32]byte
n := s.format(&arr)
return string(arr[n:])