Golang

July 8, 2024 ยท View on GitHub

For Go functions, the handler parameter must be the path to your handler's package. For example, if you have the following structure:

- src
  - testing
  - handler.go -> package main in src/testing subdirectory
  - second
  - handler.go -> package main in src/second subdirectory
- serverless.yml
- handler.go -> package main at the root of project

Your serverless.yml functions should look something like this:

provider:
  # ...
  runtime: go122
functions:
  main:
    handler: "."
  testing:
    handler: src/testing
  second:
    handler: src/second