backslashes in default string values get doubled up #1396
Labels
area/docs-generation
Generation of docs via Cobra
good-first-issue
Issues that a new contributor could make a PR for
kind/bug
A bug in cobra; unintended behavior
lifecycle/needs-pr
Ready for a PR from the community
If you have a string with backslashes (correctly escaped to be a literal
\
) if it's the cobra default value it outputs with extra slashes, presumably for escaping.flags.StringVar(&opts.something, "the-flag", "ping\\pong", "The description")
outputs with an extra slash:
--the-flag string The description (default "ping\\pong")
fmt.Sprintf("my string: %s", "ping\\pong")
outputs the correct amount of slashes:
my string: ping\pong
Is there a reason for the extra slashes? or is this unintended?
I tried looking for old issues but I couldn't find anything
The text was updated successfully, but these errors were encountered: