Skip to content

fix(bytes): trim surrounding whitespace in Parse - #66

Merged
aldas merged 1 commit into
labstack:masterfrom
sonnemusk:fix/bytes-parse-trim-space
Jul 23, 2026
Merged

fix(bytes): trim surrounding whitespace in Parse#66
aldas merged 1 commit into
labstack:masterfrom
sonnemusk:fix/bytes-parse-trim-space

Conversation

@sonnemusk

Copy link
Copy Markdown
Contributor

Summary

Parse(" 12KiB ") failed while Parse("12 KiB") already worked. Leading/trailing whitespace is common when values come from config or user input.

Trim surrounding whitespace in Parse / ParseBinary / ParseDecimal.

Test plan

  • go test ./bytes/
  • New cases for padded binary sizes

Values like " 12KiB " failed to parse even though the same number
with an internal space ("12 KiB") already works. Trim leading and
trailing whitespace before matching.
@aldas
aldas merged commit 6dd6b6e into labstack:master Jul 23, 2026
12 checks passed
@aldas

aldas commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants