Wrapping nil returns nil
This commit is contained in:
parent
ec5422f335
commit
776917b9c0
5
pkg.go
5
pkg.go
@ -51,6 +51,10 @@ func (wrapped Error) Error() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func create(err error, data interface{}) error {
|
func create(err error, data interface{}) error {
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
_, file, line, _ := runtime.Caller(2)
|
_, file, line, _ := runtime.Caller(2)
|
||||||
file = file[baseDirLength+1:]
|
file = file[baseDirLength+1:]
|
||||||
|
|
||||||
@ -62,7 +66,6 @@ func create(err error, data interface{}) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
callback(wrapped)
|
callback(wrapped)
|
||||||
|
|
||||||
return wrapped
|
return wrapped
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user