/equal4

DEPRECATED: Comparison of an error messages for Go.

Primary LanguageGoBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

equal4: DEPRECATED. Instead you can use fmt.Sprint(err1) == fmt.Sprint(err2).

Build Status Go Reference

Comparison of an error messages for Go.
Source files are distributed under the BSD-style license found in the LICENSE file.

Install

go get github.com/danil/equal4@v0.0.15

Usage

package main

import (
    "errors"
    "fmt"

    "github.com/danil/equal4"
)

func main() {
    fmt.Println(equal4.ErrorEqual(errors.New("foobar"), errors.New("bar")))
    fmt.Println(equal4.ErrorContains(errors.New("foobar"), "bar"))
    fmt.Println(equal4.ErrorMatch(errors.New("foobar"), regexp.MustCompile("bar$")))
}

Output:

false
true
true