diff --git a/google/appengine.go b/google/appengine.go index 941cbb3..64afbd3 100644 --- a/google/appengine.go +++ b/google/appengine.go @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build appengine -// +build !appenginevm +// +build appengine,!appenginevm package google @@ -30,7 +29,7 @@ type AppEngineConfig struct { // NewAppEngineConfig creates a new AppEngineConfig for the // provided auth scopes. -func NewAppEngineConfig(context appengine.Context, scopes []string) *AppEngineConfig { +func NewAppEngineConfig(context appengine.Context, scopes ...string) *AppEngineConfig { return &AppEngineConfig{ context: context, scopes: scopes, diff --git a/google/appenginevm.go b/google/appenginevm.go index 2682af8..291791a 100644 --- a/google/appenginevm.go +++ b/google/appenginevm.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build appenginevm +// +build appenginevm !appengine package google @@ -27,7 +27,7 @@ type AppEngineConfig struct { // NewAppEngineConfig creates a new AppEngineConfig for the // provided auth scopes. -func NewAppEngineConfig(context appengine.Context, scopes []string) *AppEngineConfig { +func NewAppEngineConfig(context appengine.Context, scopes ...string) *AppEngineConfig { return &AppEngineConfig{ context: context, scopes: scopes, diff --git a/google/example_test.go b/google/example_test.go index 40f8bd9..979efc5 100644 --- a/google/example_test.go +++ b/google/example_test.go @@ -112,10 +112,8 @@ func Example_serviceAccounts() { } func Example_appEngine() { - context := appengine.NewContext(nil) - config := google.NewAppEngineConfig(context, []string{ - "https://www.googleapis.com/auth/bigquery", - }) + c := appengine.NewContext(nil) + config := google.NewAppEngineConfig(c, "https://www.googleapis.com/auth/bigquery") // The following client will be authorized by the App Engine // app's service account for the provided scopes. client := http.Client{Transport: config.NewTransport()}