From cf3f877d3085598b3eabd3f5338e878f01f3c953 Mon Sep 17 00:00:00 2001 From: GalvinGao Date: Fri, 17 Feb 2023 13:17:25 -0500 Subject: [PATCH] fix: does not support error-wrapping directive `%w` --- internal/service/upyun.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/upyun.go b/internal/service/upyun.go index 788c04e7..466434dc 100644 --- a/internal/service/upyun.go +++ b/internal/service/upyun.go @@ -104,7 +104,7 @@ func (c *Upyun) VerifyImageUploadCallback(ctx *fiber.Ctx) (path string, err erro body := ctx.Body() v, err := url.ParseQuery(string(body)) if err != nil { - return "", errors.Errorf("failed to parse body: %w", err) + return "", errors.Wrap(err, "failed to parse body") } if v.Get("code") != "200" { @@ -114,7 +114,7 @@ func (c *Upyun) VerifyImageUploadCallback(ctx *fiber.Ctx) (path string, err erro timeStr := v.Get("time") timeInt, err := strconv.Atoi(timeStr) if err != nil { - return "", errors.Errorf("failed to parse time: %w", err) + return "", errors.Wrap(err, "failed to parse time") } timeT := time.Unix(int64(timeInt), 0) if timeT.Before(time.Now().Add(-time.Minute * 10)) {