Go is supported in Google functions

twitter logo github logo ・1 min read

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!")
}    

Deploy:

gcloud functions deploy HelloGet --runtime go111 --trigger-http

twitter logo DISCUSS (2)
markdown guide
 

Thanks for this posting! Meant to try this out yesterday and forgot all about it.

 

I'm excited to test more too =).
I want to write a tutorial showing how to create an endpoint, test and deploy using gitlab-ci

Classic DEV Post from Jan 3

What's your coding origin story?

How did you get your start in programming?

Renato Suero profile image
I'm a 🇧🇷 software engineer living in 🇳🇱 who loves code, learn and share.

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️