-
Notifications
You must be signed in to change notification settings - Fork 18k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/cmd/goimports: performance issue with go1.11 in modules #27287
Comments
/cc @bradfitz @josharian |
/cc @ianthehat |
This was caused by a fix to #26504 in f851253, with modules enabled it's exec'ing go list on each import to determine import path names. Temporary fix at http://golang.org/cl/132598 until goimports moves to go/packages. |
@tzneal Until this change is merged, could you advise how to pull it, for folks unfamiliar with Gerrit / googlesource? |
@mitranim Click on the Download link in the middle of the screen on the right to get three different ways to fetch the patch. |
When will that be? |
@math2001 this work is in progress. For progress updates this is the correct tracking issue (#24661 is the umbrella tracking issue for "all" tools). You might also be interested in following the fortnightly update calls we have as part of the https://groups.google.com/forum/#!forum/golang-tools group. |
Progress in https://golang.org/cl/142697 |
I tried https://golang.org./cl/128362. It works only if a working directory or its parent contains go.mod. Look I use the next script: #!/bin/bash
argc=$#
argv=($@)
for (( j=0; j<argc; j++ )); do
if [ ${argv[j]} == "-srcdir" ]; then
cd $(dirname ${argv[j+1]})
break
fi
done
goimports.bin $* |
Is this fix going to be included in 1.12? |
goimports isn't part of a release. |
goimports at tip now uses go/packages for modules. It won't be as fast as non-module mode, since it still has to shell out to |
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Compile goimports with go1.10 and go1.11, then run on google.golang.org/appengine outside of $GOPATH. Full setup:
What did you expect to see?
What did you see instead?
Outside of $GOPATH, goimports compiled with go1.11 runs much slower. Inside of $GOPATH, it's basically the same:
The text was updated successfully, but these errors were encountered: