diff --git a/utils/error.go b/utils/error.go new file mode 100644 index 00000000..1a45d159 --- /dev/null +++ b/utils/error.go @@ -0,0 +1,12 @@ +package utils + +import "errors" + +func ErrorIsOneOf(err error, targets ...error) bool { + for _, t := range targets { + if errors.Is(err, t) { + return true + } + } + return false +}