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>
34 lines
325 B
Go
34 lines
325 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"codename/goose"
|
|
)
|
|
|
|
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
|
|
}
|
|
|
|
var Set = goose.NewSet(
|
|
FooBar{},
|
|
provideFoo,
|
|
provideBar)
|