This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
tidy: convert Fprintf to Fprintln when possible #7174
Merged
rvantonder
merged 2 commits into
master
from
sourcegraph/tidy-convert-fprintf-to-fprintln-when-possible-1576174509
Dec 12, 2019
Merged
tidy: convert Fprintf to Fprintln when possible #7174
rvantonder
merged 2 commits into
master
from
sourcegraph/tidy-convert-fprintf-to-fprintln-when-possible-1576174509
Dec 12, 2019
Conversation
This file contains hidden or 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
emidoots
reviewed
Dec 12, 2019
emidoots
reviewed
Dec 12, 2019
emidoots
approved these changes
Dec 12, 2019
mrnugget
approved these changes
Dec 12, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How cool is that?!
@mrnugget apparently there's a thread on this: golang/go#18085 (comment) (creds @slimsag for hunting down the issue) |
The `Fprintln("...\n")` triggers golang/go#18085 (comment), so using `Fprint("...\n")` instead. I'm changing it for both `Fprintf` calls in this block, even though the one can be `Fprintln` and the other `Fprint`, so that it's consistent and we don't see a weird mix of `Fprintln` and `Fprintf` here.
Codecov Report
@@ Coverage Diff @@
## master #7174 +/- ##
=======================================
Coverage 39.19% 39.19%
=======================================
Files 1230 1230
Lines 64159 64159
Branches 6066 6066
=======================================
Hits 25150 25150
Misses 36709 36709
Partials 2300 2300
|
i'm late to the party, but this is really cool |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the second argument to
Fprintf
contains no format specifiers (AKA "verbs"), useFprint
instead.In our codebase, every pattern that matched the above also contains a
\n
at the end of the string, so we can further simplify the above and say that:\n
, useFprintln
instead.Created with: