chore: +Wrapf

This commit is contained in:
Artёm Mishin committed 2025-04-25 16:52:38 +03:00
1 parent 0055c6aeec
commit 956d1fe823
1 file changed
+5
+5
View File
@@ -1,6 +1,7 @@
package errors
import (
"fmt"
"reflect"
)
@@ -12,6 +13,10 @@ func Wrap(err error, message string) error {
}
}
func Wrapf(err error, format string, args ...interface{}) error {
return Wrap(err, fmt.Sprintf(format, args...))
}
func Get[T *any](err error, field string) T {
if err == nil {
return nil