aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2022-04-26 13:49:16 -0700
committerGitHub <noreply@github.com>2022-04-26 13:49:16 -0700
commitf144a35ed4ac538fae93fa3783175108738f71b9 (patch)
tree29a8c6189f7b06e9136562c12f874fc0ef738c63
parent63c2960be651bb95aaf14535bd5e36e86b6b5458 (diff)
downloadgo-cmp-f144a35ed4ac538fae93fa3783175108738f71b9.tar.gz
Additional cleanup with Go 1.13 as minimal version (#295)
-rw-r--r--cmp/cmpopts/equate.go7
-rw-r--r--cmp/cmpopts/errors_go113.go16
-rw-r--r--go.mod2
3 files changed, 8 insertions, 17 deletions
diff --git a/cmp/cmpopts/equate.go b/cmp/cmpopts/equate.go
index 62837c9..c49a756 100644
--- a/cmp/cmpopts/equate.go
+++ b/cmp/cmpopts/equate.go
@@ -6,6 +6,7 @@
package cmpopts
import (
+ "errors"
"math"
"reflect"
"time"
@@ -146,3 +147,9 @@ func areConcreteErrors(x, y interface{}) bool {
_, ok2 := y.(error)
return ok1 && ok2
}
+
+func compareErrors(x, y interface{}) bool {
+ xe := x.(error)
+ ye := y.(error)
+ return errors.Is(xe, ye) || errors.Is(ye, xe)
+}
diff --git a/cmp/cmpopts/errors_go113.go b/cmp/cmpopts/errors_go113.go
deleted file mode 100644
index 8eb2b84..0000000
--- a/cmp/cmpopts/errors_go113.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2021, The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.13
-// +build go1.13
-
-package cmpopts
-
-import "errors"
-
-func compareErrors(x, y interface{}) bool {
- xe := x.(error)
- ye := y.(error)
- return errors.Is(xe, ye) || errors.Is(ye, xe)
-}
diff --git a/go.mod b/go.mod
index b570017..f55cea6 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
module github.com/google/go-cmp
-go 1.11
+go 1.13