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