Skip to content

Commit

Permalink
refactor: refactor gRPC client initialization methods
Browse files Browse the repository at this point in the history
- Remove an empty string parameter from `InitFCMClient` call
- Replace `grpc.Dial` with `grpc.NewClient` in health example
- Replace `grpc.Dial` with `grpc.NewClient` in send example

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Jun 8, 2024
1 parent 855dddc commit a20e5be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion router/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestMain(m *testing.M) {
cfg.Android.Enabled = true
cfg.Android.Credential = os.Getenv("FCM_CREDENTIAL")

if _, err := notify.InitFCMClient(cfg, ""); err != nil {
if _, err := notify.InitFCMClient(cfg); err != nil {
log.Fatal(err)
}

Expand Down
2 changes: 1 addition & 1 deletion rpc/example/go/health/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (

func main() {
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion rpc/example/go/send/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (

func main() {
// Set up a connection to the server.
conn, err := grpc.Dial(address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(address, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatalf("did not connect: %v", err)
}
Expand Down

0 comments on commit a20e5be

Please sign in to comment.