Netlify, the hosting and web platform, allows you to create "functions" along with their CDN. These functions are hosted on AWS’ Lambda and can be accessible via a URL. So you can create static sites, with extra ability and dynamism (like we use on this site).
We wanted to share a post giving an example how to write one of these functions in Go. The aim of the code (below) is to return the version of golang.
Setup
We installed the Netlify cli to make our lives a little easier.
Create our new function, we called it go-version
1
netlify functions:create
Update the code (see below for file path and code)
Edd is a PHP and Go developer who enjoys blogging about his experiences, mostly about creating and coding new things he's working on and is a big beliver in open-source and Linux.