Git Product home page Git Product logo

Comments (4)

mvdan avatar mvdan commented on July 18, 2024

When you run that gohack config command, where is that setting stored?

Have you considered specifying the directory as part of the regular gohack some-module command? For example, if it were configurable via an environment variable, one could ensure that the variable is exported whenever one enters that directory via one of those cd magic wrappers.

An even crazier idea would be to piggyback off an existing file in a module. I can imagine a comment in go.mod, but that would be a setting for everyone cloning the repository, and not just the one author.

from gohack.

myitcv avatar myitcv commented on July 18, 2024

When you run that gohack config command, where is that setting stored?

GOHACK/.config?

Have you considered specifying the directory as part of the regular gohack some-module command?

That's quite a verbose option, yes. Almost akin to setting the environment variable as part of the command itself, e.g. GOHACK=$HOME/mywork gohack $module. It requires me to specify the directory each time.

...via one of those cd magic wrappers.

I use such a magic wrapper, but not everyone does. This sort of thing feels like an additional bar.

An even crazier idea would be to piggyback off an existing file in a module. I can imagine a comment in go.mod, but that would be a setting for everyone cloning the repository, and not just the one author.

Yes, I think this is something that doesn't work... not least because this particular example is something that is global.

from gohack.

rogpeppe avatar rogpeppe commented on July 18, 2024

I can definitely see the motivation for this idea. I might be tempted to put the config file at $GOHACK/config.txt because I don't see any particular reason for hiding it and it probably wants some kind of file extension.

Another possibility to consider is being able to specify a gohack location for a subtree. For example, I might want all modules under github.com/juju to go into /home/rog/src/work when gohacked.

from gohack.

myitcv avatar myitcv commented on July 18, 2024

I also think there is some scope for a module-local config that overrides the global well known "default". In many respects this would be similar to how a git config setting at a branch level has higher precedence that its global equivalent.

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.