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

     1  
     2  This test renames an exported method of an unexported type,
     3  which is an edge case for objectpath, since it computes a path
     4  from a syntax package that is no good when applied to an
     5  export data package.
     6  
     7  See issue #60789.
     8  
     9  -- go.mod --
    10  module example.com
    11  go 1.12
    12  
    13  -- a/a.go --
    14  package a
    15  
    16  type unexported int
    17  func (unexported) F() {} //@rename("F", "G", fToG)
    18  
    19  var _ = unexported(0).F
    20  
    21  -- b/b.go --
    22  package b
    23  
    24  // The existence of this package is sufficient to exercise
    25  // the bug even though it cannot reference a.unexported.
    26  
    27  import _ "example.com/a"
    28  
    29  -- @fToG/a/a.go --
    30  @@ -4 +4 @@
    31  -func (unexported) F() {} //@rename("F", "G", fToG)
    32  +func (unexported) G() {} //@rename("F", "G", fToG)
    33  @@ -6 +6 @@
    34  -var _ = unexported(0).F
    35  +var _ = unexported(0).G