Comments (7)
@lapwat my guess is that you haven't read the docs for this, you should be setting --build-arg GO111MODULE=on
https://docs.openfaas.com/cli/templates/
We also cover this extensively in my eBook on OpenFaaS and Go -> https://gumroad.com/l/everyday-golang
from golang-http-template.
/add label: support,question
from golang-http-template.
I guess that this option is now enabled by default: #63
I also said in the context that I have tried both options:
faas-cli build -f test-module.yml --build-arg GO111MODULE=on
- setting GO111MODULE=on in the yml file
What did I miss ?
from golang-http-template.
Can we reopen the issue ?
from golang-http-template.
Judging by the error you get, your function is not a go module.
As mentioned in the docs you should run go mod init function
to initialize your function and than use go get
to manage your dependencies.
from golang-http-template.
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 go
template.
from golang-http-template.
I have succeeded to build the image in this issue. I had to go mod init function
and go get
inside the handler folder like you advised.
I do not have to type those commands when working with the go
template which was misleading.
from golang-http-template.
Related Issues (20)
- Go modules - unable to get a sub-package to work HOT 7
- Graceful shutdown for Kubernetes
- Broken link to golang-middleware section of README.md HOT 1
- golang-http does not allow graceful request cancelling HOT 5
- Improve caching for sub-package cache HOT 1
- not set ADDITIONAL_PACKAGE arg HOT 3
- Feature: replace alpine Docker image with scratch HOT 3
- Add multi-arch support, with fallback to current behaviour HOT 3
- Feature: Add Busybox Binary Version HOT 2
- received non-zero exit code from build, error: invalid platform architecture "amd64}" HOT 1
- Getting `go: inconsistent vendoring` error when a module is located within function HOT 23
- Cannot find package HOT 2
- Enable Go modules as a default HOT 3
- Use of-watchdog 0.9.3 to suppress custom health check logging messages
- Replace ioutil HOT 3
- Add a GitHub Action to do a test build for both templates HOT 1
- Cannot publish Function after updating template HOT 7
- Unable to use vendoring with golang-http HOT 16
- chore: remove unused atomic int
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from golang-http-template.