This commit is contained in:
Magnus Åhall 2023-09-26 09:37:09 +02:00
parent ebf3a9aa38
commit 6fb67141fe

14
pkg.go
View File

@ -10,15 +10,15 @@ import (
type Error struct { type Error struct {
Wrapped error Wrapped error
File string File string
Line int Line int
Data interface{} Data interface{}
} }
type LogCallback func(Error) type LogCallback func(Error)
var ( var (
logCallback LogCallback logCallback LogCallback
baseDirLength int baseDirLength int
) )
@ -57,9 +57,9 @@ func create(err error, data interface{}) error {
wrapped := Error{ wrapped := Error{
Wrapped: err, Wrapped: err,
File: file, File: file,
Line: line, Line: line,
Data: data, Data: data,
} }
callback(wrapped) callback(wrapped)