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

     1  This test checks completion of labels.
     2  
     3  -- flags --
     4  -ignore_extra_diags
     5  
     6  -- labels.go --
     7  package labels
     8  
     9  func _() {
    10  	goto F //@complete(" //", label1, label5)
    11  
    12  Foo1: //@item(label1, "Foo1", "label", "const")
    13  	for a, b := range []int{} {
    14  	Foo2: //@item(label2, "Foo2", "label", "const")
    15  		switch {
    16  		case true:
    17  			break F //@complete(" //", label2, label1)
    18  
    19  			continue F //@complete(" //", label1)
    20  
    21  			{
    22  			FooUnjumpable:
    23  			}
    24  
    25  			goto F //@complete(" //", label1, label2, label4, label5)
    26  
    27  			func() {
    28  				goto F //@complete(" //", label3)
    29  
    30  				break F //@complete(" //")
    31  
    32  				continue F //@complete(" //")
    33  
    34  			Foo3: //@item(label3, "Foo3", "label", "const")
    35  			}()
    36  		}
    37  
    38  	Foo4: //@item(label4, "Foo4", "label", "const")
    39  		switch interface{}(a).(type) {
    40  		case int:
    41  			break F //@complete(" //", label4, label1)
    42  		}
    43  	}
    44  
    45  	break F //@complete(" //")
    46  
    47  	continue F //@complete(" //")
    48  
    49  Foo5: //@item(label5, "Foo5", "label", "const")
    50  	for {
    51  		break F //@complete(" //", label5)
    52  	}
    53  
    54  	return
    55  }