chore(functions/tips/lazy): Update sample to use declarative signature
@@ -26,12 +26,17 @@ import (
"sync"
"cloud.google.com/go/storage"
+ "github.com/GoogleCloudPlatform/functions-framework-go/functions"
)
// client is lazily initialized by LazyGlobal.
var client *storage.Client
var clientOnce sync.Once
+func init() {
+ functions.HTTP("LazyGlobal", LazyGlobal)
+}
+
// LazyGlobal is an example of lazily initializing a Google Cloud Storage client.
func LazyGlobal(w http.ResponseWriter, r *http.Request) {
// You may wish to add different checks to see if the client is needed for
