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 colon
This commit is contained in:
Kat Yang
2022-06-06 16:30:31 -04:00
committed by GitHub
parent 56eb131715
commit 31630edf0c
27 changed files with 62 additions and 107 deletions
+1 -2
View File
@@ -14,7 +14,6 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/util/errutil"
"golang.org/x/sync/errgroup"
)
@@ -120,7 +119,7 @@ func (e *cloudWatchExecutor) executeLogAction(ctx context.Context, model *simple
data, err = e.handleGetLogEvents(ctx, logsClient, model)
}
if err != nil {
return nil, errutil.Wrapf(err, "failed to execute log action with subtype: %s", subType)
return nil, fmt.Errorf("failed to execute log action with subtype: %s: %w", subType, err)
}
return data, nil
+2 -3
View File
@@ -16,7 +16,6 @@ import (
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/sqleng"
"github.com/grafana/grafana/pkg/util/errutil"
)
var logger = log.New("tsdb.postgres")
@@ -131,7 +130,7 @@ func (s *Service) generateConnectionString(dsInfo sqleng.DataSourceInfo) (string
var err error
port, err = strconv.Atoi(sp[1])
if err != nil {
return "", errutil.Wrapf(err, "invalid port in host specifier %q", sp[1])
return "", fmt.Errorf("invalid port in host specifier %q: %w", sp[1], err)
}
logger.Debug("Generating connection string with network host/port pair", "host", host, "port", port)
@@ -144,7 +143,7 @@ func (s *Service) generateConnectionString(dsInfo sqleng.DataSourceInfo) (string
var err error
port, err = strconv.Atoi(dsInfo.URL[index+1:])
if err != nil {
return "", errutil.Wrapf(err, "invalid port in host specifier %q", dsInfo.URL[index+1:])
return "", fmt.Errorf("invalid port in host specifier %q: %w", dsInfo.URL[index+1:], err)
}
logger.Debug("Generating ipv6 connection string with network host/port pair", "host", host, "port", port)
+1 -2
View File
@@ -14,7 +14,6 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/util/errutil"
)
const (
@@ -787,7 +786,7 @@ func predictableCSVWave(query backend.DataQuery, model *simplejson.Json) ([]*dat
default:
f, err := strconv.ParseFloat(rawValue, 64)
if err != nil {
return nil, errutil.Wrapf(err, "failed to parse value '%v' into nullable float", rawValue)
return nil, fmt.Errorf("failed to parse value '%v' into nullable float: %w", rawValue, err)
}
val = &f
}