diff calsync/gcalclient/service.go @ 58:6c7151126a0b

logging and refactor
author drewp@bigasterisk.com
date Thu, 05 Sep 2024 17:01:23 -0700
parents 5f7c393577e9
children
line wrap: on
line diff
--- a/calsync/gcalclient/service.go	Thu Sep 05 15:03:05 2024 -0700
+++ b/calsync/gcalclient/service.go	Thu Sep 05 17:01:23 2024 -0700
@@ -69,7 +69,7 @@
 	json.NewEncoder(f).Encode(token)
 }
 
-func newService(ctx context.Context) (error, *calendar.Service) {
+func newService(ctx context.Context) (*calendar.Service, error) {
 	b, err := os.ReadFile("./credentials.json")
 	if err != nil {
 		log.Fatalf("Unable to read client secret file: %v", err)
@@ -82,6 +82,5 @@
 	}
 	client := getClient(config)
 
-	srv, err := calendar.NewService(ctx, option.WithHTTPClient(client))
-	return err, srv
+	return calendar.NewService(ctx, option.WithHTTPClient(client))
 }