1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:04:43 -07:00
go/internal/lsp/testdata/variadic/variadic.go.in

24 lines
763 B
Go
Raw Normal View History

package variadic
func foo(i int, strs ...string) {}
func bar() []string { //@item(vFunc, "bar", "func() []string", "func")
return nil
}
func _() {
var (
i int //@item(vInt, "i", "int", "var")
s string //@item(vStr, "s", "string", "var")
ss []string //@item(vStrSlice, "ss", "[]string", "var")
)
foo() //@rank(")", vInt, vStr),rank(")", vInt, vStrSlice)
foo(123, ) //@rank(")", vStr, vInt),rank(")", vStrSlice, vInt)
foo(123, "", ) //@rank(")", vStr, vInt),rank(")", vStr, vStrSlice)
foo(123, , "") //@rank(" ,", vStr, vInt),rank(")", vStr, vStrSlice)
// snippet will add the "..." for you
foo(123, ) //@snippet(")", vStrSlice, "ss...", "ss..."),snippet(")", vFunc, "bar()...", "bar()..."),snippet(")", vStr, "s", "s")
}