Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.


Golang Example: multi-route, multi-lambda with dependencies

January 6, 2019 at 6:44pm
The ZEIT community has a new home. This thread is preserved for historical purposes. The content of this conversation may be innaccurrate or out of date. Go to new community home →

Golang Example: multi-route, multi-lambda with dependencies

January 6, 2019 at 6:44pm (Edited 1 year ago)
Example of
  • using dep to vendor dependencies
  • building multiple Go lambdas
  • routing to multiple lambdas
Note: One minor annoyance is my IDE (VSC) gives me errors for not having a func main() declared in those main packages:
runtime.main_main·f: function main is undeclared in the main package
But if you include a main method to resolve that error it breaks the now builder. I haven't looked into /go builder, but I suspect it's basically gluing in a shim with a main() method from the looks of the errors.
  • UPDATE: I updated the example repo so the IDE error is no longer an issue. Just put a func main(){} in a non-lambda .go file that is also in package main.

January 6, 2019 at 10:33pm
For Zeit, my wishlist is:
- Update with more details about how the builder works. It seems to require a lambda to be in a main package.
- It would be nice if go lambdas didn't need to be in the main package (this would supercede the previous point)
- now support to run dev mode and fire up all the lambdas ;)
  • reply
  • like

February 11, 2019 at 12:45pm
Hi, , I tried your solution, but the deployment failed, saying there is no lambda function in main.go.
  • reply
  • like
Hi if you can share more info about what your project looks like I might be able to help you.
It's an alternative Now 2.0 builder for Golang that I made. Have you tried it? I found the Zeit provided builder had a lot of issues for me.
  • reply
  • like
This channel has been archived