errors_go113.go 340 B

123456789101112131415
  1. // Copyright 2021, The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build go1.13
  5. package cmpopts
  6. import "errors"
  7. func compareErrors(x, y interface{}) bool {
  8. xe := x.(error)
  9. ye := y.(error)
  10. return errors.Is(xe, ye) || errors.Is(ye, xe)
  11. }