1
0
mirror of https://github.com/golang/go synced 2024-11-18 21:34:46 -07:00
go/internal/lsp/testdata/good/good_util.go
Rebecca Stambler fc4f04983f internal/lsp: add more testdata for completion and diagnostics
Change-Id: I2a73e51b60f76a2af0f8ff4d34220b551e0cd378
Reviewed-on: https://go-review.googlesource.com/c/150041
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2018-11-20 06:06:34 +00:00

20 lines
603 B
Go

package good //@diag("package", "")
import (
"golang.org/x/tools/internal/lsp/types" //@item(types_import, "types", "\"golang.org/x/tools/internal/lsp/types\"", "package")
)
func random() int { //@item(good_random, "random()", "int", "func")
y := 6 + 7
return y
}
func random2(y int) int { //@item(good_random2, "random2(y int)", "int", "func"),item(good_y_param, "y", "int", "var")
//@complete("", good_y_param, types_import, good_random, good_random2, good_stuff)
var b types.Bob = &types.X{}
if _, ok := b.(*types.X); ok { //@complete("X", Bob_interface, X_struct, Y_struct)
}
return y
}