diff --git a/src/goImport.ts b/src/goImport.ts index e8ce5b7a1..acd2be42c 100644 --- a/src/goImport.ts +++ b/src/goImport.ts @@ -27,7 +27,7 @@ export function listPackages(): Thenable { return vendorSupportPromise.then((vendorSupport: boolean) => { return goPkgsPromise.then((pkgs: string[]) => { - if (!vendorSupport){ + if (!vendorSupport) { return pkgs.sort().slice(1); } diff --git a/src/goInstallTools.ts b/src/goInstallTools.ts index 8da885e73..ee8beacdc 100644 --- a/src/goInstallTools.ts +++ b/src/goInstallTools.ts @@ -100,7 +100,7 @@ export function updateGoPathGoRootFromConfig() { export function setupGoPathAndOfferToInstallTools() { updateGoPathGoRootFromConfig(); isVendorSupported(); - + if (!process.env['GOPATH']) { let info = 'GOPATH is not set as an environment variable or via `go.gopath` setting in Code'; showGoStatus('GOPATH not set', 'go.gopathinfo', info); @@ -150,13 +150,13 @@ function getMissingTools(): Promise { } export function isVendorSupported(): Promise { - if (vendorSupport != null){ + if (vendorSupport != null) { return Promise.resolve(vendorSupport); } return new Promise((resolve, reject) => { cp.exec('go version', (err, stdout, stderr) => { let matches = /go version go(\d).(\d).*/.exec(stdout); - if (matches.length === 3){ + if (matches.length === 3) { let majorVersion = parseInt(matches[1]); let minorVersion = parseInt(matches[2]); switch (majorVersion) { @@ -171,7 +171,7 @@ export function isVendorSupported(): Promise { break; } return resolve(vendorSupport); - } + } reject('Issues parsing version from go version command'); }); diff --git a/test/go.test.ts b/test/go.test.ts index b6e321acb..34ada6625 100644 --- a/test/go.test.ts +++ b/test/go.test.ts @@ -190,7 +190,7 @@ encountered. let gopkgsPromise = new Promise((resolve, reject) => { cp.execFile(getBinPath('gopkgs'), [], (err, stdout, stderr) => { let pkgs = stdout.split('\n').sort().slice(1); - if (vendorSupport){ + if (vendorSupport) { vendorPkgsFullPath.forEach(pkg => { assert.equal(pkgs.indexOf(pkg) > -1, true, `Package not found by goPkgs: ${pkg}`); }); @@ -219,11 +219,11 @@ encountered. }); return Promise.all([gopkgsPromise, listPkgPromise]).then((values: string[][]) => { - if (!vendorSupport){ + if (!vendorSupport) { let originalPkgs = values[0]; let updatedPkgs = values[1]; assert.equal(originalPkgs.length, updatedPkgs.length); - for (var index = 0; index < originalPkgs.length; index++) { + for (let index = 0; index < originalPkgs.length; index++) { assert.equal(updatedPkgs[index], originalPkgs[index]); } }