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

HelperForErrorf cuts off trailing whitespaces from arguments #18

Closed
RichardJCai opened this issue May 26, 2021 · 2 comments
Closed

HelperForErrorf cuts off trailing whitespaces from arguments #18

RichardJCai opened this issue May 26, 2021 · 2 comments

Comments

@RichardJCai
Copy link

It seems like HelperForErrorf cuts off trailing whitespaces from its format arguements.

rs, _ := redact.HelperForErrorf("%s%s", " trailing white space test   ", "hello")
println(rs)

Outputs: 
‹ trailing white space test›‹hello›

Notice that the 3 spaces behind the first arg are cutoff.

May be related to #17

@knz
Copy link
Contributor

knz commented Jun 18, 2021

@RichardJCai can you explain where this came up?

Right now, the elimination of trailing spaces and newlines for unsafe strings is a feature (it has been ever since the library was created). We could reconsider, if there's a compelling use case.

@RichardJCai
Copy link
Author

@RichardJCai can you explain where this came up?

Right now, the elimination of trailing spaces and newlines for unsafe strings is a feature (it has been ever since the library was created). We could reconsider, if there's a compelling use case.

I don't think there is a compelling use case. From what I remember, I found a workaround to what I was doing.

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

No branches or pull requests

2 participants