Skip to content

Commit 5211272

Browse files
committed
chore: pkg import only once
1 parent c1cc191 commit 5211272

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

markers/markers_test.go

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package markers_test
1717
import (
1818
"context"
1919
"errors"
20-
goErr "errors"
2120
"fmt"
2221
"io"
2322
"net"
@@ -183,8 +182,8 @@ func TestKnownErrorTypeDifference(t *testing.T) {
183182
func TestStandardFmtSingleWrapRemoteEquivalence(t *testing.T) {
184183
tt := testutils.T{T: t}
185184

186-
err1 := fmt.Errorf("hello %w", goErr.New("world"))
187-
err2 := fmt.Errorf("hello %w", goErr.New("earth"))
185+
err1 := fmt.Errorf("hello %w", errors.New("world"))
186+
err2 := fmt.Errorf("hello %w", errors.New("earth"))
188187

189188
newErr1 := network(err1)
190189

@@ -281,8 +280,8 @@ func (e *myErr) Error() string {
281280
func TestStandardFmtMultierrorRemoteEquivalence(t *testing.T) {
282281
tt := testutils.T{T: t}
283282

284-
err1 := fmt.Errorf("hello %w %w", goErr.New("world"), goErr.New("one"))
285-
err2 := fmt.Errorf("hello %w %w", goErr.New("world"), goErr.New("two"))
283+
err1 := fmt.Errorf("hello %w %w", errors.New("world"), errors.New("one"))
284+
err2 := fmt.Errorf("hello %w %w", errors.New("world"), errors.New("two"))
286285

287286
newErr1 := network(err1)
288287

@@ -292,7 +291,7 @@ func TestStandardFmtMultierrorRemoteEquivalence(t *testing.T) {
292291
tt.Check(!markers.Is(newErr1, err2))
293292

294293
// Check multiple levels of causal nesting
295-
err3 := fmt.Errorf("err: %w", goErr.Join(err1, err2, &myErr{msg: "hi"}))
294+
err3 := fmt.Errorf("err: %w", errors.Join(err1, err2, &myErr{msg: "hi"}))
296295
newErr3 := network(err3)
297296
myErrV := &myErr{msg: "hi"}
298297

@@ -316,7 +315,7 @@ func (e myOtherMultiError) Unwrap() []error { return []error{e.cause} }
316315
func TestDifferentMultiErrorTypesCompareDifferentOverNetwork(t *testing.T) {
317316
tt := testutils.T{T: t}
318317

319-
base := goErr.New("woo")
318+
base := errors.New("woo")
320319
e1 := myMultiError{base}
321320
e2 := myOtherMultiError{base}
322321

@@ -333,9 +332,9 @@ func TestDifferentMultiErrorTypesCompareDifferentOverNetwork(t *testing.T) {
333332
func TestStandardFmtMultierrorRemoteRecursiveEquivalence(t *testing.T) {
334333
tt := testutils.T{T: t}
335334

336-
baseErr := goErr.New("world")
335+
baseErr := errors.New("world")
337336
err1 := fmt.Errorf("%w %w", baseErr, baseErr)
338-
err2 := goErr.Join(baseErr, baseErr)
337+
err2 := errors.Join(baseErr, baseErr)
339338

340339
tt.Check(markers.Is(err1, baseErr))
341340
tt.Check(!markers.Is(err1, err2))
@@ -621,7 +620,7 @@ func (e *myErrType2) Error() string { return e.msg }
621620
func TestFormat(t *testing.T) {
622621
tt := testutils.T{t}
623622

624-
refErr := goErr.New("foo")
623+
refErr := errors.New("foo")
625624
const woo = `woo`
626625
const waawoo = `waa: woo`
627626
testCases := []struct {
@@ -631,7 +630,7 @@ func TestFormat(t *testing.T) {
631630
expFmtVerbose string
632631
}{
633632
{"marked",
634-
markers.Mark(goErr.New("woo"), refErr),
633+
markers.Mark(errors.New("woo"), refErr),
635634
woo, `
636635
woo
637636
(1) forced error mark
@@ -641,7 +640,7 @@ Wraps: (2) woo
641640
Error types: (1) *markers.withMark (2) *errors.errorString`},
642641

643642
{"marked + wrapper",
644-
markers.Mark(&werrFmt{goErr.New("woo"), "waa"}, refErr),
643+
markers.Mark(&werrFmt{errors.New("woo"), "waa"}, refErr),
645644
waawoo, `
646645
waa: woo
647646
(1) forced error mark
@@ -654,7 +653,7 @@ Wraps: (3) woo
654653
Error types: (1) *markers.withMark (2) *markers_test.werrFmt (3) *errors.errorString`},
655654

656655
{"wrapper + marked",
657-
&werrFmt{markers.Mark(goErr.New("woo"), refErr), "waa"},
656+
&werrFmt{markers.Mark(errors.New("woo"), refErr), "waa"},
658657
waawoo, `
659658
waa: woo
660659
(1) waa

0 commit comments

Comments
 (0)