Fix the failing tests, include Go 1.13 in test matrix

This commit is contained in:
Ramya Achutha Rao 2019-10-20 12:26:32 -07:00
Родитель 282a94d623
Коммит 0839658c8d
4 изменённых файлов: 17 добавлений и 4 удалений

Просмотреть файл

@ -4,6 +4,7 @@ go:
- 1.10.x
- 1.11.x
- 1.12.x
- 1.13.x
- tip
matrix:

Просмотреть файл

@ -940,7 +940,20 @@ export function runGodoc(cwd: string, packagePath: string, receiver: string, sym
if (err) {
return reject(err.message || stderr);
}
let doc = '';
const godocLines = stdout.split('\n');
if (!godocLines.length) {
return resolve(doc);
}
// Recent versions of Go have started to include the package statement
// tht we dont need.
if (godocLines[0].startsWith('package ')) {
godocLines.splice(0, 1);
if (!godocLines[0].trim()) {
godocLines.splice(0, 1);
}
}
// Skip trailing empty lines
let lastLine = godocLines.length - 1;
@ -950,7 +963,6 @@ export function runGodoc(cwd: string, packagePath: string, receiver: string, sym
}
}
let doc = '';
for (let i = 1; i <= lastLine; i++) {
if (godocLines[i].startsWith(' ')) {
doc += godocLines[i].substring(4) + '\n';

2
test/fixtures/gogetdocTestData/test.go поставляемый
Просмотреть файл

@ -26,7 +26,7 @@ func main() {
// Hello is a method on the struct ABC. Will signature help understand this correctly
func (abcd *ABC) Hello(s string, exclaim bool) string {
net.CIDRMask(10, 20)
net.IPv4Mask(0, 0, 0, 0)
if exclaim {
s = s + "!"
}

Просмотреть файл

@ -248,7 +248,7 @@ It returns the number of bytes written and any write error encountered.
[new vscode.Position(40, 23), 'package math', 'Package math provides basic constants and mathematical functions.\n\nThis package does not guarantee bit-identical results across architectures.\n'],
[new vscode.Position(19, 6), 'func Println(a ...interface{}) (n int, err error)', printlnDoc],
[new vscode.Position(27, 14), 'type ABC struct {\n a int\n b int\n c int\n}', 'ABC is a struct, you coudn\'t use Goto Definition or Hover info on this before\nNow you can due to gogetdoc and go doc\n'],
[new vscode.Position(28, 6), 'func CIDRMask(ones, bits int) IPMask', 'CIDRMask returns an IPMask consisting of `ones\' 1 bits\nfollowed by 0s up to a total length of `bits\' bits.\nFor a mask of this form, CIDRMask is the inverse of IPMask.Size.\n']
[new vscode.Position(28, 6), 'func IPv4Mask(a, b, c, d byte) IPMask', 'IPv4Mask returns the IP mask (in 4-byte form) of the\nIPv4 mask a.b.c.d.\n']
];
const config = Object.create(vscode.workspace.getConfiguration('go'), {
'docsTool': { value: 'gogetdoc' }