Skip to content

bloblang: format string manipulation method percent escape #1691

Answered by mihaitodor
gramian asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @gramian, thanks for pointing that out! I added some extra information to the format method docs in #1728 to link the Go documentation of the fmt package which lists the valid verbs (as well as the fact that %% resolves to a literal percent sign.

While I can see that in some situations it might be desirable to use another character instead of % to specify verbs, it will introduce extra complexity which can be confusing and error-prone. I think calling something like replace_all("%", "%%") should be acceptable in most cases. Please share a detailed example if you're aware of a situation where this doesn't work well.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gramian
Comment options

@mihaitodor
Comment options

Answer selected by gramian
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants