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

     1  This test performs basic coverage of 'rename' within a single package.
     2  
     3  -- basic.go --
     4  package p
     5  
     6  func f(x int) { println(x) } //@rename("x", "y", xToy)
     7  
     8  -- @xToy/basic.go --
     9  @@ -3 +3 @@
    10  -func f(x int) { println(x) } //@rename("x", "y", xToy)
    11  +func f(y int) { println(y) } //@rename("x", "y", xToy)
    12  -- alias.go --
    13  package p
    14  
    15  // from golang/go#61625
    16  type LongNameHere struct{}
    17  type A = LongNameHere //@rename("A", "B", AToB)
    18  func Foo() A
    19  
    20  -- errors.go --
    21  package p
    22  
    23  func _(x []int) { //@renameerr("_", "blank", `can't rename "_"`)
    24  	x = append(x, 1) //@renameerr("append", "blank", "built in and cannot be renamed")
    25  	x = nil //@renameerr("nil", "blank", "built in and cannot be renamed")
    26  	x = nil //@renameerr("x", "x", "old and new names are the same: x")
    27  	_ = 1 //@renameerr("1", "x", "no identifier found")
    28  }
    29  
    30  -- @AToB/alias.go --
    31  @@ -5,2 +5,2 @@
    32  -type A = LongNameHere //@rename("A", "B", AToB)
    33  -func Foo() A
    34  +type B = LongNameHere //@rename("A", "B", AToB)
    35  +func Foo() B