Coder Social home page Coder Social logo

weird installation instructions about gofumpt HOT 5 CLOSED

mvdan avatar mvdan commented on May 27, 2024
weird installation instructions

from gofumpt.

Comments (5)

mvdan avatar mvdan commented on May 27, 2024

:) As of Go 1.11 and 1.12, it's the only way to reliably install the tool in module mode without modifying the current go.mod. If golang/go#30515 was done, we could replace that entire line with something like go get -global mvdan.cc/gofumpt.

I understand I could suggest go get mvdan.cc/gofumpt and add a warning about running this outside a module, but I think that will still confuse some users who aren't used to modules. The longer line can be copy-pasted in all scenarios, and the expert Go users can do their own thing anyway.

from gofumpt.

josharian avatar josharian commented on May 27, 2024

Yuck. Seems like we definitely need something like golang/go#30515. What I ended up doing was cloning and then running go install.

I'm not an expert Go user (when it comes to modules). I wonder whether git clone ...; cd gofumpt; go install would be more comprehensible to most folks on first pass?

from gofumpt.

mvdan avatar mvdan commented on May 27, 2024

Yes, a clone is the other option. The disadvantage being that it gets @master, not @latest (which is different if there are tagged releases), and it might not use module mode if $PWD happens to be inside $GOPATH.

And of course, it also pollutes $PWD. I think polluting /tmp or whichever other temporary directory is a bit less harmful.

Either way it's going to be multiple commands and ugly; this is just one way that I've found does what I want, works for all projects, and is usable on all Go releases since 1.11. So I'll probably be using it for a while.

from gofumpt.

rodrigc avatar rodrigc commented on May 27, 2024

@mvdan take a look at golang/go#30515 (comment) and see if that approach works for you. That is one suggestion that is being discussed.

from gofumpt.

mvdan avatar mvdan commented on May 27, 2024

Yes, I am aware of that thread; I started it. That's not the right approach I'm afraid, as someone already pointed out there.

from gofumpt.

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.