Skip to content

Commit 63c2960

Browse files
authored
remove xerrors (#292)
Versions older than Go 1.13 are no longer in use. Remove unnecessary dependencies.
1 parent 71220fc commit 63c2960

File tree

5 files changed

+7
-31
lines changed

5 files changed

+7
-31
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
7+
go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
88
os: [ubuntu-latest, macos-latest]
99
runs-on: ${{ matrix.os }}
1010
steps:

cmp/cmpopts/errors_xerrors.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

cmp/cmpopts/util_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"time"
1818

1919
"github.com/google/go-cmp/cmp"
20-
"golang.org/x/xerrors"
2120
)
2221

2322
type (
@@ -531,14 +530,14 @@ func TestOptions(t *testing.T) {
531530
reason: "user-defined EOF is not exactly equal",
532531
}, {
533532
label: "EquateErrors",
534-
x: xerrors.Errorf("wrapped: %w", io.EOF),
533+
x: fmt.Errorf("wrapped: %w", io.EOF),
535534
y: io.EOF,
536535
opts: []cmp.Option{EquateErrors()},
537536
wantEqual: true,
538537
reason: "wrapped io.EOF is equal according to errors.Is",
539538
}, {
540539
label: "EquateErrors",
541-
x: xerrors.Errorf("wrapped: %w", io.EOF),
540+
x: fmt.Errorf("wrapped: %w", io.EOF),
542541
y: io.EOF,
543542
wantEqual: false,
544543
reason: "wrapped io.EOF is not equal without EquateErrors option",
@@ -585,14 +584,14 @@ func TestOptions(t *testing.T) {
585584
reason: "user-defined EOF is not exactly equal",
586585
}, {
587586
label: "EquateErrors",
588-
x: xerrors.Errorf("wrapped: %w", io.EOF),
587+
x: fmt.Errorf("wrapped: %w", io.EOF),
589588
y: io.EOF,
590589
opts: []cmp.Option{EquateErrors()},
591590
wantEqual: true,
592591
reason: "wrapped io.EOF is equal according to errors.Is",
593592
}, {
594593
label: "EquateErrors",
595-
x: xerrors.Errorf("wrapped: %w", io.EOF),
594+
x: fmt.Errorf("wrapped: %w", io.EOF),
596595
y: io.EOF,
597596
wantEqual: false,
598597
reason: "wrapped io.EOF is not equal without EquateErrors option",
@@ -639,14 +638,14 @@ func TestOptions(t *testing.T) {
639638
reason: "user-defined EOF is not exactly equal",
640639
}, {
641640
label: "EquateErrors",
642-
x: struct{ E error }{xerrors.Errorf("wrapped: %w", io.EOF)},
641+
x: struct{ E error }{fmt.Errorf("wrapped: %w", io.EOF)},
643642
y: struct{ E error }{io.EOF},
644643
opts: []cmp.Option{EquateErrors()},
645644
wantEqual: true,
646645
reason: "wrapped io.EOF is equal according to errors.Is",
647646
}, {
648647
label: "EquateErrors",
649-
x: struct{ E error }{xerrors.Errorf("wrapped: %w", io.EOF)},
648+
x: struct{ E error }{fmt.Errorf("wrapped: %w", io.EOF)},
650649
y: struct{ E error }{io.EOF},
651650
wantEqual: false,
652651
reason: "wrapped io.EOF is not equal without EquateErrors option",

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module github.com/google/go-cmp
22

33
go 1.11
4-
5-
require golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543

go.sum

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)