-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement std.trim for string #684
Conversation
Tests added in this PR are working fine. Not sure why 2 other checks are failing. Can someone help here? |
return nil, err | ||
} | ||
sStr := str.getGoString() | ||
return makeValueString(strings.TrimSpace(sStr)), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be compatible with C++, this should be strings.Trim with explicit " \t" I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings.TrimSpace
removes all kinds of spaces '\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).
I think the tests will work if you rebase. |
Add
std.trim
function in standard library.PR for cpp-jsonnet: google/jsonnet#1067