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() {
|
|
|
|
|
// I'm on the fence as to whether this should be an error (versus an
|
|
|
|
|
// override). For now, I will make it an error that can be relaxed
|
|
|
|
|
// later.
|
|
|
|
|
fmt.Println(injectBar(40))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Foo int
|
|
|
|
|
type Bar int
|
|
|
|
|
|
2018-04-27 13:44:54 -04:00
|
|
|
var Set = goose.NewSet(
|
|
|
|
|
provideFoo,
|
|
|
|
|
provideBar)
|
|
|
|
|
|
2018-03-29 15:17:58 -07:00
|
|
|
func provideFoo() Foo {
|
|
|
|
|
return -888
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func provideBar(foo Foo) Bar {
|
|
|
|
|
return 2
|
|
|
|
|
}
|