refactor: No error return for print#1375
Merged
Merged
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. |
qweeah
requested changes
May 7, 2024
qweeah
reviewed
May 7, 2024
Contributor
|
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
Member
Author
|
Last commit only contains improved test errors |
daa358e to
00d4ada
Compare
qweeah
reviewed
May 7, 2024
qweeah
reviewed
May 7, 2024
00d4ada to
786af10
Compare
qweeah
reviewed
May 7, 2024
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
786af10 to
2acae64
Compare
FeynmanZhou
pushed a commit
to FeynmanZhou/oras
that referenced
this pull request
May 11, 2024
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.