Update installTools logic to support optional tools#509
Update installTools logic to support optional tools#509ramya-rao-a merged 5 commits intomicrosoft:masterfrom
Conversation
e1cec0c to
cf3daf4
Compare
cf3daf4 to
1a26d36
Compare
| }; | ||
|
|
||
| // Install the formattool that was chosen by the user | ||
| if (goConfig['formatTool'] === 'goimports') { |
src/goInstallTools.ts
Outdated
|
|
||
| export function installAllTools() { | ||
| installTools(Object.keys(tools)); | ||
| getGoVersion().then(() => installTools(Object.keys(getTools()))); |
There was a problem hiding this comment.
getTools is called here and then again multiple times in installTools
There was a problem hiding this comment.
Also you're not using the promise in then, why not do this?
getGoVersion().then(version => installTools(Object.keys(getTools()), version));There was a problem hiding this comment.
The version is used internally by getTools() and not installTools directly.
Refactored installedTools to not repeatedly call getTools() for each missing tool
| language: go | ||
|
|
||
| go: | ||
| - 1.5 |
There was a problem hiding this comment.
Can we amend the tests to not lint on 1.5 instead?
There was a problem hiding this comment.
Its not the tests that fail, its the install step where we install golint.
go get -u -v github.com/golang/lint/golint
I could write a custom install script that looks at the go version and then takes the decision whether or not to install golint
But, thats for another day.
I am hoping that golint creates a tag/branch that works for Go 1.5, then I can put 1.5 back here in travis, add a custom install script to target that tag/branch
There was a problem hiding this comment.
I'm concerned about removing the 1.5 test and then never adding it back again. I think it's worth adding a conditional to https://github.com/Microsoft/vscode-go/blob/master/.travis.yml if that's all that needs to happen.
There was a problem hiding this comment.
Does this work?
if [ "$(go --version)" != "1.5" ]; then go get -u -v github.com/golang/lint/golint; fiThere was a problem hiding this comment.
am trying this
if [[ "$(go version)" =~ "go version go1.5" ]]; then echo cannot get golint; else go get -u -v github.com/golang/lint/golint; fi|
@Tyriar All comments have been addressed, I think we are good to go |
The previous fix to #467 added
goimportsto the list of tools to be installed.For users who have not chosen
goimportsas their formatting tool, this change will prompt them to installgo importsvia theAnalysis Tools Missingstatus bar item.The current PR makes it so that user will be prompted to install
goimportsonly if it has been chosen as their formatting toolgolinthas dropped support for Go 1.5 This would break installing of thegolinttool on machines having Go 1.5 This also breaks travisIdeally,
golintshould provide a tag/branch which works for Go 1.5 and we should be able to use that.Until then, we suggest such users to use
gometalinterinstead