golang.org/x/tools@v0.21.0/internal/refactor/inline/testdata/revdotimport.txtar (about)

     1  Test of inlining a function into a context that already
     2  dot-imports the necessary additional import.
     3  
     4  -- go.mod --
     5  module testdata
     6  go 1.12
     7  
     8  -- a/a.go --
     9  package a
    10  
    11  func A() {}
    12  
    13  -- b/b.go --
    14  package b
    15  
    16  import "testdata/a"
    17  
    18  func B() { a.A() }
    19  
    20  -- c/c.go --
    21  package c
    22  
    23  import . "testdata/a"
    24  import "testdata/b"
    25  
    26  func _() {
    27  	A()
    28  	b.B() //@ inline(re"B", result)
    29  }
    30  
    31  -- result --
    32  package c
    33  
    34  import (
    35  	"testdata/a"
    36  	. "testdata/a"
    37  )
    38  
    39  func _() {
    40  	A()
    41  	a.A() //@ inline(re"B", result)
    42  }