diff --git a/.github/workflows/LICENSE b/LICENSE similarity index 100% rename from .github/workflows/LICENSE rename to LICENSE diff --git a/fields.go b/fields.go index 0fc0b79..c1dadf9 100644 --- a/fields.go +++ b/fields.go @@ -71,13 +71,6 @@ func (c *fields) Is(target error) bool { return ok } -// Cause returns the wrapped error which was the original -// cause of the issue. We only support this because some code -// depends on github.com/pkg/errors.Cause() returning the cause -// of the error. -// deprecated use error.Is() or error.As() instead -func (c *fields) Cause() error { return c.wrapped } - func (c *fields) Error() string { return c.wrapped.Error() } diff --git a/fields_test.go b/fields_test.go index 7b6f696..5dade2a 100644 --- a/fields_test.go +++ b/fields_test.go @@ -31,7 +31,7 @@ func TestFields(t *testing.T) { assert.Equal(t, "value1", m["key1"]) assert.Equal(t, "message: query error", m["err"]) - assert.Len(t, m, 3) + assert.Len(t, m, 2) }) t.Run("Can use errors.Is() from std `errors` package", func(t *testing.T) { @@ -60,7 +60,6 @@ func TestFields(t *testing.T) { out := fmt.Sprintf("%+v", wrap) assert.Contains(t, out, `message: query error (key1=value1)`) - var f errors.HasFields if errors.As(wrap, &f) { slog.Error("this error has log fields", f.Fields()...) }