Revert "Implement casting of *Entry to error."

This reverts commit 756db3cd2d.
This commit is contained in:
Antoine Grondin
2015-09-07 20:47:46 -04:00
parent c639bedcac
commit 38c9fd2510
2 changed files with 26 additions and 61 deletions
+2 -17
View File
@@ -8,23 +8,6 @@ import (
"github.com/stretchr/testify/assert"
)
var err = fmt.Errorf("kaboom at layer %d", 4711)
func TestToError(t *testing.T) {
assert := assert.New(t)
ctx := WithField("foo", "bar")
assert.Equal(nil, ctx.Debug("Hello").ToError())
ctx.Data[ErrorKey] = "error"
assert.Equal(nil, ctx.Debug("Hello").ToError())
ctx = ctx.WithError(err)
assert.Equal(err, ctx.Debug("Hello").ToError())
}
func TestEntryWithError(t *testing.T) {
assert := assert.New(t)
@@ -33,6 +16,8 @@ func TestEntryWithError(t *testing.T) {
ErrorKey = "error"
}()
err := fmt.Errorf("kaboom at layer %d", 4711)
assert.Equal(err, WithError(err).Data["error"])
logger := New()