-
Notifications
You must be signed in to change notification settings - Fork 646
Update installTools logic to support optional tools #509
Conversation
e1cec0c
to
cf3daf4
Compare
cf3daf4
to
1a26d36
Compare
}; | ||
|
||
// Install the formattool that was chosen by the user | ||
if (goConfig['formatTool'] === 'goimports') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is gofmt
included with Go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
|
||
export function installAllTools() { | ||
installTools(Object.keys(tools)); | ||
getGoVersion().then(() => installTools(Object.keys(getTools()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getTools
is called here and then again multiple times in installTools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version is used internally by getTools()
and not installTools
directly.
Refactored installedTools
to not repeatedly call getTools()
for each missing tool
@@ -1,7 +1,6 @@ | |||
language: go | |||
|
|||
go: | |||
- 1.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we amend the tests to not lint on 1.5 instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work?
if [ "$(go --version)" != "1.5" ]; then go get -u -v github.com/golang/lint/golint; fi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
goimports
to the list of tools to be installed.For users who have not chosen
goimports
as their formatting tool, this change will prompt them to installgo imports
via theAnalysis Tools Missing
status bar item.The current PR makes it so that user will be prompted to install
goimports
only if it has been chosen as their formatting toolgolint
has dropped support for Go 1.5 This would break installing of thegolint
tool on machines having Go 1.5 This also breaks travisIdeally,
golint
should 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
gometalinter
instead