Skip to content
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

Merged
merged 5 commits into from
Jun 13, 2023
Merged

Conversation

Tejesh-Raut
Copy link
Contributor

@Tejesh-Raut Tejesh-Raut commented Apr 14, 2023

Add std.trim function in standard library.

PR for cpp-jsonnet: google/jsonnet#1067

@Tejesh-Raut
Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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).

@sparkprime
Copy link
Contributor

I think the tests will work if you rebase.

@coveralls
Copy link

coveralls commented May 16, 2023

Coverage Status

Coverage: 68.52% (+0.03%) from 68.493% when pulling 7b87efa on Tejesh-Raut:string-trim into 44538a3 on google:master.

@sparkprime sparkprime merged commit fae8411 into google:master Jun 13, 2023
8 checks passed
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.

None yet

3 participants