2018-03-29 15:17:58 -07:00
|
|
|
package main
|
|
|
|
|
|
2018-04-27 13:44:54 -04:00
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"codename/goose"
|
|
|
|
|
)
|
2018-03-29 15:17:58 -07:00
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
fmt.Println(injectFooBar())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Foo int
|
|
|
|
|
type Bar int
|
|
|
|
|
type FooBar int
|
|
|
|
|
|
|
|
|
|
func provideFoo() Foo {
|
|
|
|
|
return 40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideBar() Bar {
|
|
|
|
|
return 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideFooBar(foo Foo, bar Bar) FooBar {
|
|
|
|
|
return FooBar(foo) + FooBar(bar)
|
|
|
|
|
}
|
2018-04-27 13:44:54 -04:00
|
|
|
|
|
|
|
|
var Set = goose.NewSet(
|
|
|
|
|
provideFoo,
|
|
|
|
|
provideBar,
|
|
|
|
|
provideFooBar)
|