News for hackers. Stuff that matters.
Re:Cloud Functions: Go 1.11 is now a supported language by dstaley on Wednesday January 16, 2019 @02:28PM (#18924124)
IIRC only the Node.js runtime has the ability to be emulated locally. Is this still the case? If I wanted to test my function locally, how would I go about doing that?
Re:Cloud Functions: Go 1.11 is now a supported language by chrisbroadfoot on Wednesday January 16, 2019 @02:33PM (#18924179)
Use regular "go test" for unit testing. If you're using metadata inside your function (e.g., to extract an event ID) you can use metadata.NewContext to pass into your function while testing: https://godoc.org/cloud.google.com/go/functions/metadata#New...

If you just want to execute your function, create another package main and start an HTTP server, as you'd normally do.

There are some examples on this page: https://cloud.google.com/functions/docs/bestpractices/testin...

We're thinking about ways to improve the local development/testing story, and are keen to hear any ideas/feedback.

Disclaimer: I work at Google, and worked on this product.

Re:Cloud Functions: Go 1.11 is now a supported language by gobuildship on Wednesday January 16, 2019 @02:42PM (#18924278)
Just do what Azure does with functions. Have used their VS Code local debug and "just worked" out of the box