I tracked this down (at least it was the source of a slow goimports for me)
and put up a CL at https://go-review.googlesource.com/c/tools/+/132598/
.The issue was that it's eventually exec'ing the go command for every
import in the presence of modules, which adds up quickly and also doesn't
I will add that I regularly see goimports with modules take many seconds to
run. I'm using acmego and I sometimes end up needing to switch that off
because it corrupts text seconds after a save.
On Fri, 9 Nov 2018, 3:26 pm Joseph Lorenzini Hi Ian/Russ,
>
> I should have clarified that I was
On Wed, Nov 7, 2018 at 7:43 PM Joseph Lorenzini wrote:
> If have a go.mod, goimports takes 30 seconds to run. If I remove the
> go.mod, then goimports takes half a second to run. Is this expected? Is
> goimports trying to do something with the packages found in go.mod? Is
> there a way to
Hi,
Could you try the module aware fork of goimports
https://github.com/heschik/goimports and let us know if it works and is
acceptable speed wise?
We are not merging it back yet because we think it may be slower for non
module users, and we want some more confidence that it is a drop in
+Tools team
30 seconds is much too slow for a tool that's used as a save hook. Ideally
we're closer to 100ms; half a second is OK. Do we have a workaround for
goimports+go.mod until the latency issues are resolved?
Thanks,
S
On Wed, Nov 7, 2018 at 7:43 PM Joseph Lorenzini wrote:
>
>
> Hi all,