From 7ddaf9667d0f94ee74adca67c6cea52ce1511893 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 12 Jan 2026 12:12:09 -0800 Subject: [PATCH] fix(gcs): use %w for error wrapping in gcs_storage_client.go Address review feedback to use idiomatic error wrapping. --- weed/remote_storage/gcs/gcs_storage_client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/remote_storage/gcs/gcs_storage_client.go b/weed/remote_storage/gcs/gcs_storage_client.go index 3c9d30183..b92f81b0f 100644 --- a/weed/remote_storage/gcs/gcs_storage_client.go +++ b/weed/remote_storage/gcs/gcs_storage_client.go @@ -65,12 +65,12 @@ func (s gcsRemoteStorageMaker) Make(conf *remote_pb.RemoteConf) (remote_storage. } else { data, err = os.ReadFile(googleApplicationCredentials) if err != nil { - return nil, fmt.Errorf("failed to read credentials file %s: %v", googleApplicationCredentials, err) + return nil, fmt.Errorf("failed to read credentials file %s: %w", googleApplicationCredentials, err) } } creds, err := google.CredentialsFromJSON(context.Background(), data, storage.ScopeFullControl) if err != nil { - return nil, fmt.Errorf("failed to parse credentials: %v", err) + return nil, fmt.Errorf("failed to parse credentials: %w", err) } httpClient := oauth2.NewClient(context.Background(), creds.TokenSource) clientOpts = append(clientOpts, option.WithHTTPClient(httpClient), option.WithoutAuthentication())