go-lang-plugin-org/go-lang-idea-plugin — pull request #724 by ctoforaday (2014-06-06 19:11:24+00:00)
Title: Fix issue 712 - allow for paths with spaces to be used

...with go fmt executed from tools menu.

This turns up a general problem with the way commands are executed in the go plugin. Runtime.exec(String) makes generally unsafe assumptions about how to split that string into individual command arguments; it's much safer to use Runtime.exec(String[]), which will preserve the atomicity of each of the individual command arguments and allows spaces to appear anywhere in the argument.

Note that this means that there are other bugs, too - anyone with a space in the path leading to the go executable will also have this problem, but the problem will be in *every* command executed, as everyone appears to be using the non-cmdArray variant of this method.