Chore: Remove Wrap (#50048)

* Chore: Remove Wrap and Wrapf

* Fix: Add error check
This commit is contained in:
Kat Yang
2022-06-03 09:24:24 +02:00
committed by GitHub
parent 53cb94a2ad
commit 3c3039f5b3
34 changed files with 104 additions and 117 deletions
+4 -3
View File
@@ -18,8 +18,6 @@ import (
"strings"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util/errutil"
)
// IntValue represents a string value in a YAML
@@ -41,7 +39,10 @@ func (val *IntValue) UnmarshalYAML(unmarshal func(interface{}) error) error {
}
val.Raw = interpolated.raw
val.value, err = strconv.Atoi(interpolated.value)
return errutil.Wrap("cannot convert value int", err)
if err != nil {
return fmt.Errorf("%v: %w", "cannot convert value int", err)
}
return err
}
// Value returns the wrapped int value