Git Product home page Git Product logo

Comments (2)

bcmills avatar bcmills commented on July 18, 2024

If they're in the same root and at compatible versions (that is, if the code within that submodule hasn't changed since the requested version), I'd say leave them in the same repository (and just update replace directives appropriately).

If they're in the same root at incompatible versions, maybe emit an error?

from gohack.

rogpeppe avatar rogpeppe commented on July 18, 2024

If they're in the same root and at compatible versions (that is, if the code within that submodule hasn't changed since the requested version), I'd say leave them in the same repository (and just update replace directives appropriately).
If they're in the same root at incompatible versions, maybe emit an error?

I'm not entirely sure whether that's a good idea. The error situation you describe will be increasingly likely the larger a program is. It would be frustrating to want to add a printf somewhere in a large program only to be told that it can't be done because of a version clash.

Note that this issue also applies when you've got multiple major versions of a repository. I think it's reasonable to want to hack on both example.com/m and example.com/m/v2 at the same time, but the current approach wouldn't allow that.

I'm currently thinking of checking out all modules to $GOHACK/module/_mod instead of just $GOHACK/module. That way this issue goes away because it's perfectly OK to have example.com/m/_mod and examples.com/m/v2/_mod.

The down side is that you might well want to use the same directory for both. There's always go mod edit --replace for that, I suppose.

from gohack.

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.