Skip to content

Commit 9226027

Browse files
committed
fix(google): Fix Error on Google PubSub Client
Fix error on NewPubSubClient & CreateTopic
1 parent e5a0e38 commit 9226027

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

google/pubsub.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package google
33
import (
44
"context"
55
"errors"
6+
"fmt"
67

78
"cloud.google.com/go/pubsub"
89
)
@@ -21,7 +22,7 @@ func NewPubSubClient(projectID string) (PubSubService, error) {
2122

2223
client, err := pubsub.NewClient(ctx, projectID)
2324
if err != nil {
24-
return nil, errors.New("Error creating Google Pub/Sub client: %v", err)
25+
return nil, errors.New(fmt.Sprintf("Error creating Google Pub/Sub client: %v", err))
2526
}
2627

2728
return &gcpubsub{client}, nil
@@ -36,7 +37,7 @@ func (g *gcpubsub) CreateTopic(topicID string) (*pubsub.Topic, error) {
3637

3738
topic, err := g.client.CreateTopic(ctx, topicID)
3839
if err != nil {
39-
return nil, errors.New("Error creating topic: %v", err)
40+
return nil, errors.New(fmt.Sprintf("Error creating topic: %v", err))
4041
}
4142

4243
return topic, nil

0 commit comments

Comments
 (0)