2018-04-02 16:35:59 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"bar"
|
2018-04-27 13:44:54 -04:00
|
|
|
"codename/goose"
|
2018-04-02 16:35:59 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
fmt.Println(injectFooBar())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Foo int
|
|
|
|
|
type FooBar int
|
|
|
|
|
|
2018-04-27 13:44:54 -04:00
|
|
|
var Set = goose.NewSet(
|
|
|
|
|
provideFoo,
|
|
|
|
|
bar.ProvideBar,
|
|
|
|
|
provideFooBar)
|
|
|
|
|
|
2018-04-02 16:35:59 -07:00
|
|
|
func provideFoo() Foo {
|
|
|
|
|
return 41
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideFooBar(foo Foo, barVal bar.Bar) FooBar {
|
|
|
|
|
return FooBar(foo) + FooBar(barVal)
|
|
|
|
|
}
|