[code] Remove the useless deps download control option (#43940)

The `installGoDependency` should be the only way to notify go langserver
to install the deps.
This commit is contained in:
Henry Wong 2019-08-28 12:11:44 +08:00 committed by GitHub
parent 833d662a6c
commit 4be35ba0ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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',
},
});