To avoid making this CL too large, I did not migrate the existing goose comments through the repository. This will be addressed in a subsequent CL. Reviewed-by: Tuo Shan <shantuo@google.com>
30 lines
407 B
Go
30 lines
407 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"codename/goose"
|
|
)
|
|
|
|
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
|
|
|
|
var Set = goose.NewSet(
|
|
provideFoo,
|
|
provideBar)
|
|
|
|
func provideFoo() Foo {
|
|
return -888
|
|
}
|
|
|
|
func provideBar(foo Foo) Bar {
|
|
return 2
|
|
}
|