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

     1  Test of references between the extra files of a test variant
     2  and the regular package.
     3  
     4  -- go.mod --
     5  module example.com
     6  go 1.12
     7  
     8  -- a/a.go --
     9  package a
    10  
    11  func fn() {} //@loc(def, "fn"), refs("fn", def, use)
    12  
    13  type t struct { g int } //@loc(gdef, "g")
    14  type u struct { t }
    15  
    16  var _ = new(u).g //@loc(gref, "g"), refs("g", gdef, gref)
    17  // TODO(adonovan): fix: gref2 and gdef2 are missing.
    18  
    19  -- a/a_test.go --
    20  package a
    21  
    22  func _() {
    23  	fn() //@loc(use, "fn")
    24  
    25  	_ = new(u).g //@loc(gref2, "g"), refs("g", gdef2, gref, gref2)
    26  }
    27  
    28  // This declaration changes the meaning of u.t in the test.
    29  func (u) g() {} //@loc(gdef2, "g")