Skip to content

Match canonical whitespace trimming - #915

Open
vinsymoyya wants to merge 1 commit into
google:masterfrom
vinsymoyya:fix/trim-whitespace-parity
Open

vinsymoyya wants to merge 1 commit into
google:masterfrom
vinsymoyya:fix/trim-whitespace-parity

Conversation

@vinsymoyya

Copy link
Copy Markdown

Fixes #912.

Use the canonical whitespace character set for std.trim instead of Go's broader Unicode TrimSpace set. This preserves characters such as U+2000 that the portable stdlib retains, while still trimming ASCII whitespace, NEL, and NBSP.

Six regression cases fail on the original implementation and pass with the one-line fix; controls cover the supported whitespace set and empty strings. The separate regression file is registered in Bazel.

Validation: focused tests pass on Go 1.27.4 Windows; go test -buildvcs=false ./... passes on Go 1.24.13 Linux from the exact commit archive; gofmt and git diff --check pass. Bazel and C/Python integration checks were not run locally.

This branch has not been deployed

No deployments
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.

Native trim removes characters preserved by the canonical stdlib

1 participant