-
Notifications
You must be signed in to change notification settings - Fork 181
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
refactor: No error return for print #1375
Conversation
6c66d5a
to
070b7e8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1375 +/- ##
==========================================
+ Coverage 84.75% 84.81% +0.06%
==========================================
Files 104 104
Lines 3712 3715 +3
==========================================
+ Hits 3146 3151 +5
+ Misses 338 336 -2
Partials 228 228 ☔ View full report in Codecov by Sentry. |
If // Println prints objects concurrent-safely with newline.
func (p *Printer) Println(a ...any) error {
p.lock.Lock()
defer p.lock.Unlock()
_, err := fmt.Fprintln(p.out, a...)
if err != nil {
err = fmt.Errorf("display output error: %w", err)
_, _ = fmt.Fprint(os.Stderr, err)
}
return err
} |
edc4efe
to
9e5c050
Compare
Last commit only contains improved test errors |
daa358e
to
00d4ada
Compare
00d4ada
to
786af10
Compare
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
786af10
to
2acae64
Compare
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.
LGTM
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
What this PR does / why we need it:
I don't think we should consider print errors a problem most of the time and we should manage the output of the error to print only once.