Skip to content

Commit

Permalink
[code] Remove the useless deps download control option (elastic#43940) (
Browse files Browse the repository at this point in the history
elastic#44207)

The `installGoDependency` should be the only way to notify go langserver
to install the deps.
  • Loading branch information
Henry Wong authored Aug 28, 2019
1 parent c75371e commit e5ff3d5
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions x-pack/legacy/plugins/code/server/lsp/go_launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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, {
Expand All @@ -119,7 +110,6 @@ export class GoServerLauncher extends AbstractLauncher {
GOROOT: goRoot,
GOPATH: goPath,
PATH: envPath,
GO111MODULE: go111MODULE,
CGO_ENABLED: '0',
},
});
Expand Down

0 comments on commit e5ff3d5

Please sign in to comment.