Template creates a golang project that expects gomodules. So you will need 1.11 incase you already have go installed
Official Installation guidelines
Official Installation Guidelines
or
brew upgrade
brew update
brew tap aws/tap
brew install aws-sam-cli
sam init -l https://github.com/kdevar/sam-lambda-go.git -o $GOPATH/src/<repo-location>/
#prompt for project_name
#prompt for repo_location (e.g. github.com/kdevar)
For example
sam init -l https://github.com/kdevar/sam-lambda-go.git -o $HOME/go/src/github.com/kdevar
# project_name: my-test
# repo_location: github.com/kdevar
You only need to specify the full git url the first time you use the template. Subsequent times can be done simply as sam-lambda-go
.
sam init -l sam-lambda-go -o $HOME/go/src/github.com/kdevar
...
Unless of course you want the latest changes to the template...in which case use the full git url
cd $HOME/go/src/github.com/kdevar/my-test
code .
Follow instructions in the readme of the newly created project