Abacn commented on a change in pull request #17173:
URL: https://github.com/apache/beam/pull/17173#discussion_r835604331



##########
File path: sdks/go/pkg/beam/io/datastoreio/datastore.go
##########
@@ -32,8 +32,20 @@ import (
        "github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
        "github.com/apache/beam/sdks/v2/go/pkg/beam/log"
        "google.golang.org/api/iterator"
+       "google.golang.org/api/option"
 )
 
+type clientType interface {
+       Run(context.Context, *datastore.Query) *datastore.Iterator
+       Close() error
+}
+
+// call to newClient returns an instance of datastore.Client
+// redirect this call for unit test usage
+var newClient = func(ctx context.Context, projectID string, opts 
...option.ClientOption) (clientType, error) {

Review comment:
       Thanks so much for the suggestions! If I understood correctly, does the 
unit test then have to call the unexported `query` function directly, with a 
newClient function type?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to