golang.org/x/tools/gopls@v0.15.3/internal/test/marker/testdata/completion/channel.txt (about)

     1  This test checks completion related to channels.
     2  
     3  -- flags --
     4  -ignore_extra_diags
     5  
     6  -- settings.json --
     7  {
     8  	"completeUnimported": false
     9  }
    10  
    11  -- channel.go --
    12  package channel
    13  
    14  func _() {
    15  	var (
    16  		aa = "123" //@item(channelAA, "aa", "string", "var")
    17  		ab = 123   //@item(channelAB, "ab", "int", "var")
    18  	)
    19  
    20  	{
    21  		type myChan chan int
    22  		var mc myChan
    23  		mc <- a //@complete(" //", channelAB, channelAA)
    24  	}
    25  
    26  	{
    27  		var ac chan int //@item(channelAC, "ac", "chan int", "var")
    28  		a <- a //@complete(" <-", channelAC, channelAA, channelAB)
    29  	}
    30  
    31  	{
    32  		var foo chan int //@item(channelFoo, "foo", "chan int", "var")
    33  		wantsInt := func(int) {} //@item(channelWantsInt, "wantsInt", "func(int)", "var")
    34  		wantsInt(<-) //@rank(")", channelFoo, channelAB)
    35  	}
    36  }