Debian Codegraph @

internal/refactor/inline/testdata/import-comments2.txtar

raw
1 Regression test for migration of comments in deleted imports (#67336).
2
3 -- go.mod --
4 module testdata
5 go 1.20
6
7 -- define/my/typ/foo.go --
8 package typ
9 type T int
10
11 -- some/other/pkg/foo.go --
12 package pkg
13 import "context"
14 import "testdata/define/my/typ"
15 func Foo(typ.T) context.Context{ return nil }
16
17 -- one/more/pkg/foo.go --
18 package pkg
19 func Bar() {}
20
21 -- to/be/inlined/foo.go --
22 package inlined
23
24 import "context"
25 import "testdata/some/other/pkg"
26 import "testdata/define/my/typ"
27
28 // inlineme
29 func Baz(ctx context.Context) context.Context {
30 return pkg.Foo(typ.T(5))
31 }
32
33 -- b/c/foo.go --
34 package c
35 import (
36 "context"
37 "testdata/to/be/inlined"
38 "testdata/one/more/pkg"
39 )
40
41 const (
42 // This is a constant
43 someConst = 5
44 )
45
46 func foo() {
47 inlined.Baz(context.TODO()) //@inline(re"Baz", out)
48 pkg.Bar()
49 }
50
51 -- out --
52 package c
53
54 import (
55 "context"
56 "testdata/define/my/typ"
57 pkg0 "testdata/some/other/pkg"
58
59 "testdata/one/more/pkg"
60 )
61
62 const (
63 // This is a constant
64 someConst = 5
65 )
66
67 func foo() {
68 var _ context.Context = context.TODO()
69 pkg0.Foo(typ.T(5)) //@inline(re"Baz", out)
70 pkg.Bar()
71 }