From 9f24030c6ee25f98037833b15a6d97c9ea27a222 Mon Sep 17 00:00:00 2001 From: Adam Gardner Date: Mon, 10 Feb 2025 16:57:31 -1000 Subject: [PATCH] fix: clean up merge mistake --- internal/google/client.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/internal/google/client.go b/internal/google/client.go index 497242d..5cb6215 100644 --- a/internal/google/client.go +++ b/internal/google/client.go @@ -17,8 +17,8 @@ package google import ( "context" - "strings" "errors" + "strings" "golang.org/x/oauth2/google" admin "google.golang.org/api/admin/directory/v1" @@ -124,13 +124,14 @@ func (c *client) GetUsers(query string) ([]*admin.User, error) { // The Google api doesn't support multi-part queries, but we do so we need to split into an array of query strings queries := strings.Split(query, ",") - - // Then call the api one query at a time, appending to our list - for _, subQuery := range queries { - err = c.service.Users.List().Query(subQuery).Customer(c.customerId).Pages(c.ctx, func(users *admin.Users) error { - u = append(u, users.Users...) - return nil - }) + + // Then call the api one query at a time, appending to our list + for _, subQuery := range queries { + err = c.service.Users.List().Query(subQuery).Customer(c.customerId).Pages(c.ctx, func(users *admin.Users) error { + u = append(u, users.Users...) + return nil + }) + } } // some people prefer to go by a mononym @@ -146,9 +147,9 @@ func (c *client) GetUsers(query string) ([]*admin.User, error) { // Check we've got some users otherwise something is wrong. if len(u) == 0 { return u, errors.New("google api returned 0 users?") - } + } return u, err - + }