Skip to content

Commit

Permalink
Additional cleanup with Go 1.13 as minimal version
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnet committed Apr 26, 2022
1 parent 63c2960 commit af174ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
7 changes: 7 additions & 0 deletions cmp/cmpopts/equate.go
Expand Up @@ -6,6 +6,7 @@
package cmpopts

import (
"errors"
"math"
"reflect"
"time"
Expand Down Expand Up @@ -136,6 +137,12 @@ func EquateErrors() cmp.Option {
return cmp.FilterValues(areConcreteErrors, cmp.Comparer(compareErrors))
}

func compareErrors(x, y interface{}) bool {
xe := x.(error)
ye := y.(error)
return errors.Is(xe, ye) || errors.Is(ye, xe)
}

// areConcreteErrors reports whether x and y are types that implement error.
// The input types are deliberately of the interface{} type rather than the
// error type so that we can handle situations where the current type is an
Expand Down
16 changes: 0 additions & 16 deletions cmp/cmpopts/errors_go113.go

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
@@ -1,3 +1,3 @@
module github.com/google/go-cmp

go 1.11
go 1.13

0 comments on commit af174ab

Please sign in to comment.