Skip to content

Commit 4b52e43

Browse files
committed
package.json: disable go.installDependenciesWhenBuilding by default
If the GOROOT is not writable, any go build that triggers rebuild/reinstall of std packages will fail if `-i` flag is given. Since go1.10, the flag `-i` is unnecessary if the main purpose of it is to improve caching. VS Code Go kept using this `-i` flag by default in GOPATH mode only because `github.com/mdempsky/gocode` may still depend on it. Now more users started to pick up gopls and Go modules are getting more widely adopted, let's switch this problematic default. Fixes #568 Change-Id: Ib1a9531ce213c6880fa046355e53eecef6575a5e Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/251263 Reviewed-by: Rebecca Stambler <[email protected]>
1 parent c7c4188 commit 4b52e43

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ Default: `false`
244244

245245
### `go.installDependenciesWhenBuilding`
246246

247-
If true, then `-i` flag will be passed to `go build` everytime the code is compiled.
247+
If true, then `-i` flag will be passed to `go build` everytime the code is compiled. Since Go 1.10, setting this may be unnecessary unless you are in GOPATH mode and do not use the language server.
248248

249-
Default: `true`
249+
Default: `false`
250250

251251
### `go.languageServerExperimentalFeatures`
252252

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,8 +1174,8 @@
11741174
},
11751175
"go.installDependenciesWhenBuilding": {
11761176
"type": "boolean",
1177-
"default": true,
1178-
"description": "If true, then `-i` flag will be passed to `go build` everytime the code is compiled.",
1177+
"default": false,
1178+
"description": "If true, then `-i` flag will be passed to `go build` everytime the code is compiled. Since Go 1.10, setting this may be unnecessary unless you are in GOPATH mode and do not use the language server.",
11791179
"scope": "resource"
11801180
},
11811181
"go.lintOnSave": {

0 commit comments

Comments
 (0)