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

Use raw literal for string formatting #46

Merged
merged 1 commit into from
Sep 28, 2017
Merged

Use raw literal for string formatting #46

merged 1 commit into from
Sep 28, 2017

Commits on Sep 28, 2017

  1. Use raw literal for string formatting

    When formatting strings, avoid using strconv.Quote if the string looks
    like it has already been escaped. Instead, use a raw string literal
    by wrapping the string with '`' characters if possible.
    For now, we still use strconv.Quote if the input string contains newlines
    to maintain the property that Format outputs a single line.
    
    Also, prefix strings obtained by the Stringer.String method with a 's'.
    This allows users to more easily distinguish when an output really is
    of type string or if the String method was used.
    dsnet committed Sep 28, 2017
    Configuration menu
    Copy the full SHA
    68a0143 View commit details
    Browse the repository at this point in the history