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 5//go:build !go1.13 6// +build !go1.13 7 8// TODO(≥go1.13): For support on <go1.13, we use the xerrors package. 9// Drop this file when we no longer support older Go versions. 10 11package cmpopts 12 13import "golang.org/x/xerrors" 14 15func compareErrors(x, y interface{}) bool { 16 xe := x.(error) 17 ye := y.(error) 18 return xerrors.Is(xe, ye) || xerrors.Is(ye, xe) 19} 20