Comparison of an error messages for Go.
Source files are distributed under the BSD-style license
found in the LICENSE file.
go get github.com/danil/equal4@v0.0.15
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