1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:54:44 -07:00
go/internal/lsp/testdata/channel/channel.go

26 lines
581 B
Go
Raw Normal View History

package channel
func _() {
var (
aa = "123" //@item(channelAA, "aa", "string", "var")
ab = 123 //@item(channelAB, "ab", "int", "var")
)
{
type myChan chan int
var mc myChan
mc <- a //@complete(" //", channelAB, channelAA)
}
{
var ac chan int //@item(channelAC, "ac", "chan int", "var")
a <- a //@complete(" <-", channelAC, channelAA, channelAB)
}
{
var foo chan int //@item(channelFoo, "foo", "chan int", "var")
wantsInt := func(int) {} //@item(channelWantsInt, "wantsInt", "func(int)", "var")
wantsInt(<-) //@rank(")", channelFoo, channelAB)
}
}