2018-04-02 14:08:17 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
2018-04-27 13:44:54 -04:00
|
|
|
"codename/goose"
|
|
|
|
|
"foo"
|
2018-04-02 14:08:17 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
fmt.Println(injectFooer().Foo())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Bar string
|
|
|
|
|
|
|
|
|
|
func (b *Bar) Foo() string {
|
|
|
|
|
return string(*b)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideBar() *Bar {
|
|
|
|
|
b := new(Bar)
|
|
|
|
|
*b = "Hello, World!"
|
|
|
|
|
return b
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-27 13:44:54 -04:00
|
|
|
var Set = goose.NewSet(
|
|
|
|
|
provideBar,
|
|
|
|
|
goose.Bind(foo.Fooer(nil), (*Bar)(nil)))
|