I'm building golang lambda functions using the serverless framework in AWS CodeBuild. This project is in a private bitbucket repository. And the CodeBuild source is the bitbucket repo
I'm having some problems of using local packages in the code.
I have this project structure
hello
test
test.go
main.go
serverless.yml
...other files
what I'm trying to do is to use package test
in hello/test/test.go
in the hello/main.go
.
And I've tried 2 options.
- Import the package using "myproject/hello/test"
- Using bitbucket url and
dep ensure
. Movingtest
to another project.
the problems:
- in AWS CodeBuild, the package cannot be found as the real package directory is
/....aws path/bitbucket.org/<username>/<repo>/
and the$GOPATH
is/...aws path/
. - dep ensure freezes when writing the private bitbucket repo. I'm assuming that it's because authentication issues?
So, what can I do to use my golang packages in AWS CodeBuild? And it's a private repo not a public one.