#335 caller skip count.
Some checks failed
lint / lint (pull_request) Has been cancelled
pr / test (pull_request) Has been cancelled

This commit is contained in:
Gorbunov Kirill Andreevich 2024-04-14 17:06:23 +03:00
parent bb0c415a77
commit a9426dfea5

View File

@ -176,3 +176,16 @@ func WithMicroKeys() options.Option {
return nil
}
}
func WithIncCallerSkipCount(n int) options.Option {
return func(src interface{}) error {
c, err := options.Get(src, ".CallerSkipCount")
if err != nil {
return err
}
if err = options.Set(src, c.(int)+n, ".CallerSkipCount"); err != nil {
return err
}
return nil
}
}