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

fix: #1026 remove go 1.5 support #2319

Merged
merged 4 commits into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/goDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function definitionLocation(document: vscode.TextDocument, position: vsco
cwd: (modFolderPath && modFolderPath !== getModuleCache())
? modFolderPath : (getWorkspaceFolderPath(document.uri) || path.dirname(document.fileName))
};
if (toolForDocs === 'godoc' || (ver && (ver.major < 1 || (ver.major === 1 && ver.minor < 6)))) {
if (toolForDocs === 'godoc') {
return definitionLocation_godef(input, token);
} else if (toolForDocs === 'guru') {
return definitionLocation_guru(input, token);
Expand Down
4 changes: 2 additions & 2 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,13 @@ export function promptForMissingTool(tool: string) {
return;
}
getGoVersion().then((goVersion) => {
if (goVersion && goVersion.major === 1 && goVersion.minor < 6) {
if (goVersion && goVersion.major === 1 && goVersion.minor < 9) {
if (tool === 'golint') {
vscode.window.showInformationMessage('golint no longer supports go1.8, update your settings to use gometalinter as go.lintTool and install gometalinter');
return;
}
if (tool === 'gotests') {
vscode.window.showInformationMessage('Generate unit tests feature is not supported as gotests tool needs go1.6 or higher.');
vscode.window.showInformationMessage('Generate unit tests feature is not supported as gotests tool needs go1.9 or higher.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has gotests really stopped supported versions below 1.9?

return;
}
}
Expand Down
22 changes: 2 additions & 20 deletions test/go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { getAllPackages } from '../src/goPackages';
import { getImportPath } from '../src/util';
import { goPlay } from '../src/goPlayground';
import { runFillStruct } from '../src/goFillStruct';
import { version } from 'punycode';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this import?


suite('Go Extension Tests', () => {
let gopath = process.env['GOPATH'];
Expand Down Expand Up @@ -290,6 +291,7 @@ It returns the number of bytes written and any write error encountered.
// golint supports only latest 3 versions, so skip the test
return Promise.resolve();
}

return check(vscode.Uri.file(path.join(fixturePath, 'errorsTest', 'errors.go')), config).then(diagnostics => {
const allDiagnostics = [].concat.apply([], diagnostics.map(x => x.errors));
let sortedDiagnostics = allDiagnostics.sort((a: any, b: any) => a.line - b.line);
Expand Down Expand Up @@ -317,11 +319,6 @@ It returns the number of bytes written and any write error encountered.
}

getGoVersion().then(version => {
if (version && version.major === 1 && version.minor < 6) {
// gotests is not supported in Go 1.5, so skip the test
return Promise.resolve();
}

let uri = vscode.Uri.file(path.join(generateTestsSourcePath, 'generatetests.go'));
return vscode.workspace.openTextDocument(uri).then(document => {
return vscode.window.showTextDocument(document).then(editor => {
Expand All @@ -348,11 +345,6 @@ It returns the number of bytes written and any write error encountered.
}

getGoVersion().then(version => {
if (version && version.major === 1 && version.minor < 6) {
// gotests is not supported in Go 1.5, so skip the test
return Promise.resolve();
}

let uri = vscode.Uri.file(path.join(generateFunctionTestSourcePath, 'generatetests.go'));
return vscode.workspace.openTextDocument(uri).then(document => {
return vscode.window.showTextDocument(document).then((editor: vscode.TextEditor) => {
Expand Down Expand Up @@ -382,11 +374,6 @@ It returns the number of bytes written and any write error encountered.
}

getGoVersion().then(version => {
if (version && version.major === 1 && version.minor < 6) {
// gotests is not supported in Go 1.5, so skip the test
return Promise.resolve();
}

let uri = vscode.Uri.file(path.join(generatePackageTestSourcePath, 'generatetests.go'));
return vscode.workspace.openTextDocument(uri).then(document => {
return vscode.window.showTextDocument(document).then(editor => {
Expand All @@ -408,11 +395,6 @@ It returns the number of bytes written and any write error encountered.

test('Gometalinter error checking', (done) => {
getGoVersion().then(version => {
if (version && version.major === 1 && version.minor < 6) {
// golint in gometalinter is not supported in Go 1.5, so skip the test
return Promise.resolve();
}

let config = Object.create(vscode.workspace.getConfiguration('go'), {
'lintOnSave': { value: 'package' },
'lintTool': { value: 'gometalinter' },
Expand Down