golang.org/x/tools/gopls@v0.15.3/internal/test/marker/testdata/rename/methods.txt (about) 1 This test exercises renaming of interface methods. 2 3 The golden is currently wrong due to https://github.com/golang/go/issues/58506: 4 the reference to B.F in package b should be renamed too. 5 6 -- go.mod -- 7 module example.com 8 go 1.12 9 10 -- a/a.go -- 11 package a 12 13 type A int 14 15 func (A) F() {} //@renameerr("F", "G", errAfToG) 16 17 -- b/b.go -- 18 package b 19 20 import "example.com/a" 21 import "example.com/c" 22 23 type B interface { F() } //@rename("F", "G", BfToG) 24 25 var _ B = a.A(0) 26 var _ B = c.C(0) 27 28 -- c/c.go -- 29 package c 30 31 type C int 32 33 func (C) F() {} //@renameerr("F", "G", errCfToG) 34 35 -- d/d.go -- 36 package d 37 38 import "example.com/b" 39 40 var _ = b.B.F 41 42 -- @errAfToG -- 43 a/a.go:5:10: renaming this method "F" to "G" 44 b/b.go:6:6: would make example.com/a.A no longer assignable to interface B 45 b/b.go:6:20: (rename example.com/b.B.F if you intend to change both types) 46 -- @BfToG/b/b.go -- 47 @@ -6 +6 @@ 48 -type B interface { F() } //@rename("F", "G", BfToG) 49 +type B interface { G() } //@rename("F", "G", BfToG) 50 -- @BfToG/d/d.go -- 51 @@ -5 +5 @@ 52 -var _ = b.B.F 53 +var _ = b.B.G 54 -- @errCfToG -- 55 c/c.go:5:10: renaming this method "F" to "G" 56 b/b.go:6:6: would make example.com/c.C no longer assignable to interface B 57 b/b.go:6:20: (rename example.com/b.B.F if you intend to change both types)