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

     1  This test checks completion of map keys and values.
     2  
     3  -- flags --
     4  -ignore_extra_diags
     5  
     6  -- settings.json --
     7  {
     8  	"completeUnimported": false
     9  }
    10  
    11  -- maps.go --
    12  package maps
    13  
    14  func _() {
    15  	var aVar int          //@item(mapVar, "aVar", "int", "var")
    16  
    17  	// not comparabale
    18  	type aSlice []int     //@item(mapSliceType, "aSlice", "[]int", "type")
    19  
    20  	*aSlice     //@item(mapSliceTypePtr, "*aSlice", "[]int", "type")
    21  
    22  	// comparable
    23  	type aStruct struct{} //@item(mapStructType, "aStruct", "struct{...}", "struct")
    24  
    25  	map[]a{} //@complete("]", mapSliceType, mapStructType),snippet("]", mapSliceType, "*aSlice")
    26  
    27  	map[a]a{} //@complete("]", mapSliceType, mapStructType)
    28  	map[a]a{} //@complete("{", mapSliceType, mapStructType)
    29  }