-
Notifications
You must be signed in to change notification settings - Fork 58
Cannot build with go modules #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@lapwat my guess is that you haven't read the docs for this, you should be setting https://docs.openfaas.com/cli/templates/ We also cover this extensively in my eBook on OpenFaaS and Go -> https://gumroad.com/l/everyday-golang |
/add label: support,question |
I guess that this option is now enabled by default: #63 I also said in the context that I have tried both options:
What did I miss ? |
Can we reopen the issue ? |
Judging by the error you get, your function is not a go module. As mentioned in the docs you should run |
I think that this process of 'go getting' packages is handled by the Dockerfile. Note that I don't have this error when using the original |
I have succeeded to build the image in this issue. I had to I do not have to type those commands when working with the |
My actions before raising this issue
I would like to use go modules in my openfaas function.
Expected Behaviour
I whould be able to build my function by enabling GO111MODULE.
Current Behaviour
Building fail with this error:
Steps to Reproduce (for bugs)
We are going to build a function with "golang.org/x/example/stringutil" module
faas new --lang=golang-middleware test-module
test-module/handler.go
Context
Pulled latest golang-middleware template.
GO111MODULE is now enabled by default.
I tried with build-args option on the cli and in test-module.yml without success.
Your Environment
faas-cli version
):CLI:
commit: 72816d486cf76c3089b915dfb0b66b85cf096634
version: 0.13.13
Docker version
docker version
(e.g. Docker 17.0.05 ): 20.10.12Are you using Docker Swarm or Kubernetes (FaaS-netes)? Irrelevant
Operating System and version (e.g. Linux, Windows, MacOS): Linux
Code example or link to GitHub repo or gist to reproduce problem: Irrelevant
Other diagnostic information / logs from troubleshooting guide
Next steps
You may join Slack for community support.
The text was updated successfully, but these errors were encountered: