Go is supported in Google functions

renatosuero

Renato Suero

Posted on January 17, 2019

Go is supported in Google functions

Now we can use Go to run google functions =). Take a look an example:

// Package helloworld provides a set of Cloud Function samples.
package helloworld

import (
        "fmt"
        "net/http"
)

// HelloGet is an HTTP Cloud Function.
func HelloGet(w http.ResponseWriter, r *http.Request) {
        fmt.Fprint(w, "Hello, World!")
}    
Enter fullscreen mode Exit fullscreen mode

Deploy:

gcloud functions deploy HelloGet --runtime go111 --trigger-http
Enter fullscreen mode Exit fullscreen mode

💖 💪 🙅 🚩
renatosuero
Renato Suero

Posted on January 17, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related