Wrapping nil returns nil

This commit is contained in:
Magnus Åhall 2023-09-27 07:32:50 +02:00
parent ec5422f335
commit 776917b9c0

5
pkg.go
View File

@ -51,6 +51,10 @@ func (wrapped Error) Error() string {
}
func create(err error, data interface{}) error {
if err == nil {
return nil
}
_, file, line, _ := runtime.Caller(2)
file = file[baseDirLength+1:]
@ -62,7 +66,6 @@ func create(err error, data interface{}) error {
}
callback(wrapped)
return wrapped
}