2018-04-03 21:11:53 -07:00
|
|
|
package main
|
|
|
|
|
|
2018-04-27 13:44:54 -04:00
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"codename/goose"
|
|
|
|
|
)
|
2018-04-03 21:11:53 -07:00
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
fb := injectFooBar()
|
|
|
|
|
fmt.Println(fb.Foo, fb.Bar)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Foo int
|
|
|
|
|
type Bar int
|
|
|
|
|
|
|
|
|
|
type FooBar struct {
|
|
|
|
|
Foo Foo
|
|
|
|
|
Bar Bar
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideFoo() Foo {
|
|
|
|
|
return 41
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideBar() Bar {
|
|
|
|
|
return 1
|
|
|
|
|
}
|
2018-04-27 13:44:54 -04:00
|
|
|
|
|
|
|
|
var Set = goose.NewSet(
|
|
|
|
|
FooBar{},
|
|
|
|
|
provideFoo,
|
|
|
|
|
provideBar)
|