aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.51k stars 1.17k forks source link

sam init --runtime go is not working #1058

Closed yang-wei closed 5 years ago

yang-wei commented 5 years ago

Description

Briefly describe the bug you are facing.

Steps to reproduce

➜  ~ sam --version
SAM CLI, version 0.13.0
➜  ~ sam init --runtime golang
Usage: sam init [OPTIONS]

Error: Invalid value for "-r" / "--runtime": invalid choice: golang. (choose from dotnetcore1.0, go1.x, dotnet, java, nodejs6.10, nodejs8.10, dotnetcore2.1, nodejs, ruby, python3.7, dotnetcore2.0, dotnetcore, go, python3.6, python2.7, java8, python, ruby2.5)

➜  ~ sam init --runtime go
[+] Initializing project structure...
Error: An error occurred while generating this sam-app: A valid repository for "/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-go" could not be found in the following locations:
/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-go
/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-go

Expected result

A template is created

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: mac
  2. sam --version: 0.13.0

Add --debug flag to command you are running

petrogko commented 5 years ago

Just ran across this issue. They changed the name of the directory from

/usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-go to /usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-golang

In order to get this working just rename the directory back to /usr/local/Cellar/aws-sam-cli/0.13.0/libexec/lib/python3.7/site-packages/samcli/local/init/templates/cookiecutter-aws-sam-hello-go

I would create a back of the original just in case. But this seems to be a simple fix.

jfuss commented 5 years ago

Was release in v0.14.1

Closing