Skip to content

Tolerate nil primary error in multi error #18

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

Merged
merged 1 commit into from
Jan 29, 2023
Merged

Conversation

vearutop
Copy link
Member

Fixes #17

@github-actions
Copy link

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 8 752 (+8) 494 (+6) 101 157 (+2) 71 (+3) 17.3K (+125B)
Go (test) 8 577 (+5) 420 (+4) 31 126 (+1) 8 15.1K (+212B)
Markdown 4 (+3) 152 (+41) 112 (+31) 0 40 (+10) 0 4.1K (+915B)
YAML 6 483 (+9) 397 36 50 (+9) 0 16K (+339B)

@github-actions
Copy link

Go API Changes

# summary
Inferred base version: v1.2.0
Suggested version: v1.2.1

@github-actions
Copy link

Unit Test Coverage

total: (statements) 94.1%
changed lines: (statements) 100.0%

Coverage of changed lines
File Function Coverage
Total 100.0%
error.go 100.0%
error.go:326 Error 100.0%
Coverage diff with base branch

No changes in coverage.

@github-actions
Copy link

Benchmark Result

Benchmark diff with base branch
name                     old time/op    new time/op    delta
SetFields-2                 408ns ± 1%     410ns ± 2%    ~     (p=0.310 n=6+6)
StructuredError_Error-2     627ns ± 0%     628ns ± 1%    ~     (p=0.394 n=6+6)
Fmt_Errorf-2                327ns ± 2%     323ns ± 0%  -1.25%  (p=0.002 n=6+6)
WrapError-2                 810ns ± 3%     802ns ± 0%    ~     (p=0.108 n=6+5)

name                     old alloc/op   new alloc/op   delta
SetFields-2                  224B ± 0%      224B ± 0%    ~     (all equal)
StructuredError_Error-2      224B ± 0%      224B ± 0%    ~     (all equal)
Fmt_Errorf-2                96.0B ± 0%     96.0B ± 0%    ~     (all equal)
WrapError-2                  256B ± 0%      256B ± 0%    ~     (all equal)

name                     old allocs/op  new allocs/op  delta
SetFields-2                  5.00 ± 0%      5.00 ± 0%    ~     (all equal)
StructuredError_Error-2      6.00 ± 0%      6.00 ± 0%    ~     (all equal)
Fmt_Errorf-2                 2.00 ± 0%      2.00 ± 0%    ~     (all equal)
WrapError-2                  5.00 ± 0%      5.00 ± 0%    ~     (all equal)
Benchmark result
name                     time/op
SetFields-2              410ns ± 2%
StructuredError_Error-2  628ns ± 1%
Fmt_Errorf-2             323ns ± 0%
WrapError-2              802ns ± 0%

name                     alloc/op
SetFields-2               224B ± 0%
StructuredError_Error-2   224B ± 0%
Fmt_Errorf-2             96.0B ± 0%
WrapError-2               256B ± 0%

name                     allocs/op
SetFields-2               5.00 ± 0%
StructuredError_Error-2   6.00 ± 0%
Fmt_Errorf-2              2.00 ± 0%
WrapError-2               5.00 ± 0%

@codecov-commenter
Copy link

Codecov Report

Merging #18 (19001d0) into master (79ab0c3) will increase coverage by 0.16%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage   91.30%   91.46%   +0.16%     
==========================================
  Files           6        6              
  Lines         207      211       +4     
==========================================
+ Hits          189      193       +4     
  Misses         11       11              
  Partials        7        7              
Flag Coverage Δ
unittests 91.46% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
error.go 93.22% <100.00%> (+0.23%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@vearutop vearutop merged commit 50affbb into master Jan 29, 2023
@vearutop vearutop deleted the nil-primary-err branch January 29, 2023 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ctxd.MultiError can receive nil primary error
2 participants