appengine context in client, err := storage.NewClient(ctx) does not work

66 views
Skip to first unread message

mschlimp

unread,
Jun 12, 2019, 3:15:59 PM6/12/19
to google-appengine-go
Hi,

https://github.com/GoogleCloudPlatform/golang-samples/blob/8deb2909eadf32523007fd8fe9e8755a12c6d463/docs/appengine/storage/app.go

this example shows how to use app engine and google cloud storage.


if I use this line in my code:

client, err := storage.NewClient(ctx)

produce the error:

cannot use gae_context (type appengine.Context) as type "context".Context in argument to "cloud.google.com/go/storage".NewClient:
	appengine.Context does not implement "context".Context (missing Deadline method)


What is the right way to do it in appengine?


//
marcel

dir Ls

unread,
Jun 12, 2019, 11:00:41 PM6/12/19
to google-appengine-go
Hello, you can see


Specifically, refer to

"Use request.Context() or your preferred context instead of using appengine.NewContext."

GCP Client SDK doesn't depend on appengine APIs.
Reply all
Reply to author
Forward
0 new messages