Comments (3)
We run go mod edit -json
from each directory to be formatted to figure out what Go module each Go package belongs to. That is what you are seeing above; this is not related to us running gofmt
in any way.
Indeed this appears to be a problem with your asdf setup; it appears to just make running go
much slower. I'm not sure what kind of fix you expect gofumpt to do here; there is no Go API to figure out what module a package belongs to. That information is only available through executing cmd/go.
from gofumpt.
I had been suffering with this issue for almost two years (I used to think it was some weird OS/machine problem) and I only lately discovered the cause here by accident (refactoring the project setup to use go run gofumpt
instead of $PATH/gofumpt
) and noticed the sudden improvement in performance, in which case I started trying to figure out the difference and noticed the different $PATH.
I am reporting this issue mainly to help others discover this cause more easily. I don't really know what could possibly be done about it (I guess the only reaiistic "fix" is to make asdf shims faster or warn if it is invoked at high frequency?)
from gofumpt.
My only advice would be to stop using Go version wrappers like asdf :) More often than not they will be rather slow, especially when running tools on top of them, as they will often need to invoke go
multiple times in sequence. I'm fairly sure gopls
would have a very similar issue.
Go these days has a way to manage versions itself - see https://go.dev/doc/toolchain. It does add a bit of overhead, but it's cached, so in the fast path it barely adds any overhead; I seem to recall it was under a few milliseconds.
Beacuse wrappers like asdf are meant to be transparent, there's really not much that gofumpt can do. Raising an issue there sounds like a good idea, although I'm not sure what would be the best solution there other than just making the wrapper fast enough that it isn't noticeable, like GOTOOLCHAIN.
from gofumpt.
Related Issues (20)
- 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
- Split long lines only available behind environment string
- Publish v1 HOT 2
- how to ignore certain folders? HOT 8
- Alias imported package to match the package name
- Group adjacent short variable declarations HOT 1
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.