mirror of https://github.com/grafana/grafana
Chore: Remove Wrapf (#50128)
* Chore: Remove Wrapf * Remove all Wrapf refs * Remove last Wrapf ref * Fix lint errors * Remove Wrap and Wrapf definitions * Remove unnecessary colonpull/50276/head
parent
56eb131715
commit
31630edf0c
@ -1,24 +0,0 @@ |
||||
package errutil |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
// Wrap is a simple wrapper around fmt.Errorf that wraps errors.
|
||||
func Wrap(message string, err error) error { |
||||
if err == nil { |
||||
return nil |
||||
} |
||||
|
||||
return fmt.Errorf("%v: %w", message, err) |
||||
} |
||||
|
||||
// Wrapf is a simple wrapper around fmt.Errorf that wraps errors.
|
||||
// Wrapf allows you to send a format and args instead of just a message.
|
||||
func Wrapf(err error, message string, a ...interface{}) error { |
||||
if err == nil { |
||||
return nil |
||||
} |
||||
|
||||
return Wrap(fmt.Sprintf(message, a...), err) |
||||
} |
Loading…
Reference in new issue