Giter VIP home page Giter VIP logo

Comments (7)

alexellis avatar alexellis commented on June 1, 2024

@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.

alexellis avatar alexellis commented on June 1, 2024

/add label: support,question

from golang-http-template.

lapwat avatar lapwat commented on June 1, 2024

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.

lapwat avatar lapwat commented on June 1, 2024

Can we reopen the issue ?

from golang-http-template.

welteki avatar welteki commented on June 1, 2024

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.

lapwat avatar lapwat commented on June 1, 2024

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.

lapwat avatar lapwat commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.