From e5ff3d58279c5654515351a4301c8fdddedb840a Mon Sep 17 00:00:00 2001 From: Henry Wong Date: Wed, 28 Aug 2019 14:34:34 +0800 Subject: [PATCH] [code] Remove the useless deps download control option (#43940) (#44207) The `installGoDependency` should be the only way to notify go langserver to install the deps. --- x-pack/legacy/plugins/code/server/lsp/go_launcher.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/x-pack/legacy/plugins/code/server/lsp/go_launcher.ts b/x-pack/legacy/plugins/code/server/lsp/go_launcher.ts index 7c4e956537564..016afdc18eb49 100644 --- a/x-pack/legacy/plugins/code/server/lsp/go_launcher.ts +++ b/x-pack/legacy/plugins/code/server/lsp/go_launcher.ts @@ -14,9 +14,9 @@ import { Logger } from '../log'; import { ServerOptions } from '../server_options'; import { LoggerFactory } from '../utils/log_factory'; import { AbstractLauncher } from './abstract_launcher'; +import { ExternalProgram } from './process/external_program'; import { LanguageServerProxy } from './proxy'; import { InitializeOptions, RequestExpander } from './request_expander'; -import { ExternalProgram } from './process/external_program'; const GO_LANG_DETACH_PORT = 2091; @@ -98,15 +98,6 @@ export class GoServerLauncher extends AbstractLauncher { if (!fs.existsSync(goPath)) { fs.mkdirSync(goPath); } - let go111MODULE = 'off'; - if (this.options.security.installGoDependency) { - // There are no proper approaches to disable downloading go dependencies except creating inconsistencies of the - // running environments of go-langserver. Given that go language server will do its best to convert the repos - // into modules, one of the doable approaches is setting 'GO111MODULE' to false to be incompatible with the - // moduled repos. - go111MODULE = 'on'; - } - const params: string[] = ['-port=' + port.toString()]; const golsp = path.resolve(installationPath, launchersFound[0]); const p = spawn(golsp, params, { @@ -119,7 +110,6 @@ export class GoServerLauncher extends AbstractLauncher { GOROOT: goRoot, GOPATH: goPath, PATH: envPath, - GO111MODULE: go111MODULE, CGO_ENABLED: '0', }, });