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:
Ross Light
2018-04-02 16:35:59 -07:00
parent b92ac73ae3
commit 50dbe5a65d
5 changed files with 43 additions and 0 deletions

View 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)
}