Giter Club home page Giter Club logo

Comments (3)

Dokiys avatar Dokiys commented on August 20, 2024 2

I meet the same problem. In my case -mod=mod can not work in go workspace.

from wire.

alexus1024 avatar alexus1024 commented on August 20, 2024

Have the same issue for
go version go1.21.6 darwin/arm64 and the latest wire v0.6.0
My project uses go workspaces (there is go.work file in the root). This is the main reason for the issue, probably.

It is fixable by removing "-mod=mod" from the generated wire_gen.go file. But it returns after the next code generation.

Here is the problematic line: https://github.com/google/wire/blame/e57deea2f8bbe2386b756f2555e02de33e20a3f0/internal/wire/wire.go#L270
PR: #353

It makes wire not fully compatible with go workspaces

from wire.

alexus1024 avatar alexus1024 commented on August 20, 2024

One solution that would work for me:
When the wire gen -header_file flag is specified, do not output the first 3 lines in a generated file ("DO NOT EDIT" comment, new line, go-generate command).

from wire.

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.