diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2022-02-01 12:36:24 -0500 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2022-02-01 12:36:24 -0500 |
| commit | d76cb3b452891fc1bdda75e1db2be6753ffcc427 (patch) | |
| tree | 2c0e40104ff329055d3f6a72e178e338f5c56871 /gcp | |
| parent | a2265a15117611e1fcc6a7ed3cf5f3d625f2f4a7 (diff) | |
Fix lint failures around error strings
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'gcp')
| -rw-r--r-- | gcp/meta.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcp/meta.go b/gcp/meta.go index 894e9445..bf80821b 100644 --- a/gcp/meta.go +++ b/gcp/meta.go @@ -1,6 +1,7 @@ package gcp import ( + "fmt" "io/ioutil" "net/http" "strconv" @@ -8,8 +9,6 @@ import ( "sync" "time" - "github.com/pkg/errors" - "github.com/hairyhenderson/gomplate/v3/env" ) @@ -39,7 +38,7 @@ func GetClientOptions() ClientOptions { t, err := strconv.Atoi(timeout) if err != nil { - panic(errors.Wrapf(err, "Invalid GCP_TIMEOUT value '%s' - must be an integer\n", timeout)) + panic(fmt.Errorf("invalid GCP_TIMEOUT value '%s' - must be an integer: %w", timeout, err)) } co.Timeout = time.Duration(t) * time.Millisecond @@ -113,7 +112,7 @@ func (c *MetaClient) retrieveMetadata(url string, def ...string) (string, error) body, err := ioutil.ReadAll(resp.Body) if err != nil { - return "", errors.Wrapf(err, "Failed to read response body from %s", url) + return "", fmt.Errorf("failed to read response body from %s: %w", url, err) } value := strings.TrimSpace(string(body)) c.cache[url] = value |
