Skip to content

Commit

Permalink
examples: make compatible with go1.18 to pass lint
Browse files Browse the repository at this point in the history
  • Loading branch information
brandondyck committed Sep 9, 2024
1 parent 9f8e98c commit 517e8a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func ExampleErrorIs() {
e1 := errors.New("e1")
e2 := errors.New("e2")
e3 := errors.New("e3")
errorChain := errors.Join(e1, e2, e3)
errorChain := fmt.Errorf("%w%w%w", e1, e2, e3)

Check failure on line 308 in examples_test.go

View workflow job for this annotation

GitHub Actions / run-tests (ubuntu-24.04)

fmt.Errorf call has more than one error-wrapping directive %w

Check failure on line 308 in examples_test.go

View workflow job for this annotation

GitHub Actions / run-tests (macos-14)

fmt.Errorf call has more than one error-wrapping directive %w

Check failure on line 308 in examples_test.go

View workflow job for this annotation

GitHub Actions / run-tests (windows-2022)

fmt.Errorf call has more than one error-wrapping directive %w
ErrorIs(t, errorChain, e2)
// Output:
}
Expand All @@ -314,7 +314,7 @@ func ExampleErrorAs() {
e1 := errors.New("e1")
e2 := FakeError("foo")
e3 := errors.New("e3")
errorChain := errors.Join(e1, e2, e3)
errorChain := fmt.Errorf("%w%w%w", e1, e2, e3)

Check failure on line 317 in examples_test.go

View workflow job for this annotation

GitHub Actions / run-tests (ubuntu-24.04)

fmt.Errorf call has more than one error-wrapping directive %w

Check failure on line 317 in examples_test.go

View workflow job for this annotation

GitHub Actions / run-tests (macos-14)

fmt.Errorf call has more than one error-wrapping directive %w

Check failure on line 317 in examples_test.go

View workflow job for this annotation

GitHub Actions / run-tests (windows-2022)

fmt.Errorf call has more than one error-wrapping directive %w
var target FakeError
ErrorAs(t, errorChain, &target)
fmt.Println(target.Error())
Expand Down
4 changes: 2 additions & 2 deletions must/examples_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 517e8a6

Please sign in to comment.