Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Sep 20, 2016
1 parent ce6b912 commit e390d0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/goImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function listPackages(): Thenable<string[]> {

return vendorSupportPromise.then((vendorSupport: boolean) => {
return goPkgsPromise.then((pkgs: string[]) => {
if (!vendorSupport){
if (!vendorSupport) {
return pkgs.sort().slice(1);
}

Expand Down
8 changes: 4 additions & 4 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -150,13 +150,13 @@ function getMissingTools(): Promise<string[]> {
}

export function isVendorSupported(): Promise<boolean> {
if (vendorSupport != null){
if (vendorSupport != null) {
return Promise.resolve(vendorSupport);
}
return new Promise<boolean>((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) {
Expand All @@ -171,7 +171,7 @@ export function isVendorSupported(): Promise<boolean> {
break;
}
return resolve(vendorSupport);
}
}

reject('Issues parsing version from go version command');
});
Expand Down
6 changes: 3 additions & 3 deletions test/go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ encountered.
let gopkgsPromise = new Promise<string[]>((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}`);
});
Expand Down Expand Up @@ -219,11 +219,11 @@ encountered.
});

return Promise.all<string[]>([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]);
}
}
Expand Down

0 comments on commit e390d0c

Please sign in to comment.