mrserverless / serverless-golang

AWS Lambda Go functions using Serverless Framework and Python shim
Other
302 stars 21 forks source link

Support in dep #11

Closed lielran closed 7 years ago

lielran commented 7 years ago

since go dep doing to be the official dependency management tool for Golang. it's a good idea to support it in the build phase.

I try to do that by changing the Makefile but faced an issue with: 1)installing it - the usually way is go get -u github.com/golang/dep/cmd/dep which is required git installed 2)using the vendor folder for the completion(no not GOPATH)

mrserverless commented 7 years ago

@lielran someone tweeted me the same question the other day. I will either add an example or modify the existing examples with vendor support.

mrserverless commented 7 years ago

@lielran dep support has been added in https://github.com/yunspace/serverless-golang/commit/46c92a6d5d35d8de25b021288579a4cf693b62e9

1) resolved by using a docker image that contains both git and dep. Then mounting $GOPATH/src only so that $GOPATH/bin/dep doesn't get overwritten. 2) use the actual $GOPATH/src/app as the docker working dir. This was inspired by https://github.com/eawsy/aws-lambda-go-shim/blob/master/src/Makefile.example#L32

Please test this out and let me know if you find any issues.