remove causer
diff --git a/errors.go b/errors.go
index 06e6f7e..1c3c713 100644
--- a/errors.go
+++ b/errors.go
@@ -33,12 +33,3 @@
}
return err
}
-
-// cause implements the interface required by Cause.
-type cause struct {
- err error
-}
-
-func (c *cause) Cause() error {
- return c.err
-}
diff --git a/errors_test.go b/errors_test.go
index b88e016..e024b5d 100644
--- a/errors_test.go
+++ b/errors_test.go
@@ -38,10 +38,11 @@
func (nilError) Error() string { return "nil error" }
type causeError struct {
- cause
+ cause error
}
func (e *causeError) Error() string { return "cause error" }
+func (e *causeError) Cause() error { return e.cause }
func TestCause(t *testing.T) {
tests := []struct {
@@ -65,7 +66,7 @@
want: io.EOF,
}, {
// caused error returns cause
- err: &causeError{cause{err: io.EOF}},
+ err: &causeError{cause: io.EOF},
want: io.EOF,
}}