goose: add a test for imports across packages
Reviewed-by: Tuo Shan <shantuo@google.com> Reviewed-by: Herbie Ong <herbie@google.com>
This commit is contained in:
26
internal/goose/testdata/PkgImport/foo/foo.go
vendored
Normal file
26
internal/goose/testdata/PkgImport/foo/foo.go
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"bar"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println(injectFooBar())
|
||||
}
|
||||
|
||||
type Foo int
|
||||
type FooBar int
|
||||
|
||||
//goose:provide Set
|
||||
func provideFoo() Foo {
|
||||
return 41
|
||||
}
|
||||
|
||||
//goose:import Set "bar".Bar
|
||||
|
||||
//goose:provide Set
|
||||
func provideFooBar(foo Foo, barVal bar.Bar) FooBar {
|
||||
return FooBar(foo) + FooBar(barVal)
|
||||
}
|
||||
Reference in New Issue
Block a user