Since releasing Node.js and Python as supported languages for Google Cloud Functions this summer, our team has been hard at work. Today, we're excited to announce support for Go on Cloud Functions.
Now in beta, the runtime uses the latest version, Go 1.11, which includes new language features like modules for integrating third-party dependencies into your code. Starting today, you can write Go functions that scale dynamically in response to load and integrate seamlessly with Google Cloud events.
Two ways to Go
Let’s take a look at the two types of functions that you can use with Cloud Functions: HTTP functions and background functions.
HTTP functions are what their name suggests: functions that are invoked by HTTP requests. They follow the http.HandlerFunc type from the standard library. For example, an HTTP function that returns a caller’s IP address might look like this: