DEV Community

Renato Suero
Renato Suero

Posted on

4 1

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

Top comments (2)

Collapse
 
shindakun profile image
Steve Layton • Edited

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

Collapse
 
renatosuero profile image
Renato Suero

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

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay