diff --git a/.travis.yml b/.travis.yml index 4f42a222d..eef10b1f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ go: - 1.7.x - 1.8.x - 1.9.x + - '1.10' - tip sudo: false @@ -12,15 +13,9 @@ os: - osx - linux -# Exclude linux for tip as go get fails there for some reason -matrix: - exclude: - - go: tip - os: linux - before_install: - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; + export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sudo apt-get update && sudo apt-get install -y libsecret-1-0; fi diff --git a/src/goFillStruct.ts b/src/goFillStruct.ts index 93a906f04..d8d51adce 100644 --- a/src/goFillStruct.ts +++ b/src/goFillStruct.ts @@ -16,10 +16,10 @@ interface GoFillStructOutput { code: string; } -export function runFillStruct(editor: vscode.TextEditor) { +export function runFillStruct(editor: vscode.TextEditor): Promise { let args = getCommonArgs(editor); if (!args) { - return; + return Promise.reject('No args'); } return execFillStruct(editor, args); diff --git a/src/util.ts b/src/util.ts index b19e03730..7837db52f 100644 --- a/src/util.ts +++ b/src/util.ts @@ -197,7 +197,7 @@ export function getGoVersion(): Promise { } return new Promise((resolve, reject) => { cp.execFile(goRuntimePath, ['version'], {}, (err, stdout, stderr) => { - let matches = /go version go(\d).(\d).*/.exec(stdout); + let matches = /go version go(\d).(\d+).*/.exec(stdout); if (matches) { goVersion = { major: parseInt(matches[1]), @@ -765,4 +765,4 @@ export function killTree(processId: number): void { } catch (err) { } } -} \ No newline at end of file +} diff --git a/test/go.test.ts b/test/go.test.ts index 3901388d5..2537ec509 100644 --- a/test/go.test.ts +++ b/test/go.test.ts @@ -851,7 +851,7 @@ It returns the number of bytes written and any write error encountered. }); let linterTestPath = path.join(fixturePath, 'linterTest'); let expected = [ - { file: path.join(linterTestPath, 'linter_1.go'), line: 8, severity: 'warning', msg: 'error return value not checked (a declared but not used) (errcheck, errcheck)' }, + { file: path.join(linterTestPath, 'linter_1.go'), line: 8, severity: 'warning', msg: 'error return value not checked (a declared but not used) (errcheck' }, { file: path.join(linterTestPath, 'linter_2.go'), line: 5, severity: 'warning', msg: 'error return value not checked (missing return) (errcheck)' }, { file: path.join(linterTestPath, 'linter_1.go'), line: 5, severity: 'warning', msg: 'exported function ExportedFunc should have comment or be unexported (golint)' }, ]; @@ -865,7 +865,7 @@ It returns the number of bytes written and any write error encountered. }); for (let i in expected) { let errorMsg = `Failed to match expected error #${i}: ${JSON.stringify(sortedDiagnostics)}`; - assert.equal(sortedDiagnostics[i].msg, expected[i].msg, errorMsg); + assert(sortedDiagnostics[i].msg.startsWith(expected[i].msg), errorMsg); assert.equal(sortedDiagnostics[i].file.toLowerCase(), expected[i].file.toLowerCase(), errorMsg); assert.equal(sortedDiagnostics[i].line, expected[i].line, errorMsg); assert.equal(sortedDiagnostics[i].severity, expected[i].severity, errorMsg);