Comments (5)
:) 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.
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.
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.
@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.
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)
- Tracking issue: go release tag fails semver version check HOT 2
- Members of struct after Pass-through type inside struct's formatting is ignored HOT 2
- install as a CLI HOT 2
- Remove empty lines in if and for similar to functions HOT 13
- Proposal: Clothe naked returns HOT 10
- panic while handling some //line directives HOT 2
- Breaks import comment HOT 1
- feature: Enforce line breaks between multiline function calls with func() argument HOT 1
- add simplifications for Go 1.22 HOT 1
- panic: invalid semver string: "v1.22rc2" HOT 1
- Making every added formatting rule Optional HOT 3
- missing binary release at latest version-v0.6.0 HOT 1
- Single import should not be grouped with parentheses
- Generated file not ignored HOT 2
- prevent indentation confusion
- Gofumpt removing newlines before comments HOT 7
- gofumpt is very slow when `go` is behind an asdf shim HOT 3
- Split long lines only available behind environment string
- Publish v1 HOT 2
- how to ignore certain folders?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gofumpt.