From 6b742c063749cf221564fffefc29bcb41b0dd504 Mon Sep 17 00:00:00 2001 From: Mythic3011 <42365807+mythic3011@users.noreply.github.com> Date: Fri, 25 Sep 2026 03:54:49 +0800 Subject: [PATCH 1/2] fix(google_drive): use errors.New for token error strings go vet flags fmt.Errorf(e.Error) as a non-constant format string. Use errors.New when no formatting is required. --- drivers/google_drive/util.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/google_drive/util.go b/drivers/google_drive/util.go index 042abafa44..3abc364dcb 100644 --- a/drivers/google_drive/util.go +++ b/drivers/google_drive/util.go @@ -2,6 +2,7 @@ package google_drive import ( "context" + "errors" "crypto/x509" "encoding/pem" "fmt" @@ -170,7 +171,7 @@ func (d *GoogleDrive) refreshToken() error { } log.Debug(res.String()) if e.Error != "" { - return fmt.Errorf(e.Error) + return errors.New(e.Error) } d.AccessToken = resp.AccessToken return nil @@ -192,7 +193,7 @@ func (d *GoogleDrive) refreshToken() error { } log.Debug(res.String()) if e.Error != "" { - return fmt.Errorf(e.Error) + return errors.New(e.Error) } d.AccessToken = resp.AccessToken return nil From 2786a18bffc4b06db133490e59d57a6922184d6b Mon Sep 17 00:00:00 2001 From: Mythic3011 <42365807+mythic3011@users.noreply.github.com> Date: Fri, 25 Sep 2026 03:55:26 +0800 Subject: [PATCH 2/2] style(google_drive): gofmt import order after errors.New fix --- drivers/google_drive/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/google_drive/util.go b/drivers/google_drive/util.go index 3abc364dcb..c6f3351ef7 100644 --- a/drivers/google_drive/util.go +++ b/drivers/google_drive/util.go @@ -2,9 +2,9 @@ package google_drive import ( "context" - "errors" "crypto/x509" "encoding/pem" + "errors" "fmt" "io" "net/http"