-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
50 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters