go-serverless-template

module
v0.0.0-...-22791d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MIT

README

go-serverless-template

Template for Golang serverless applications.

Deploys an AWS Lambda application by utilizing Serverless Framework (v3). Env file (i.e., .env) is used for configuration.

Since this tries to follow the 3 Musketeers pattern, the following are heavily used:

Usage

configure
$ make .env
  • see generated .env file for configuration

Note: For deployment via CI/CD, CICD_MODE environment variable should be set to true in the build server. All env configuration should then be set in the build server's environment variables. They will automatically be used if .env is generated from .env.cicd. See Docker's handling of env variables from host environment for more details.

tidy dependencies
$ make deps
run tests
$ make test
build serverless functions
$ make build
  • this generates bin directory to be used in deployment
deploy serverless application
$ make deploy
Helpers during development:
format all .go files in project (using go fmt)
$ make fmt
generate test mocks (to be used with stretchr/testify) for all interfaces in project
$ make mocks
  • can be configured in .mockery.yml

Directories

Path Synopsis
functions
hello command
mocks
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL