goose: use marker functions instead of comments
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>
This commit is contained in:
@@ -28,8 +28,6 @@ func (b *Bar) Foo() string {
|
||||
return string(*b)
|
||||
}
|
||||
|
||||
//goose:provide
|
||||
//goose:bind provideBar Fooer *Bar
|
||||
func provideBar() *Bar {
|
||||
mu.Lock()
|
||||
provideBarCalls++
|
||||
@@ -44,7 +42,6 @@ var (
|
||||
provideBarCalls int
|
||||
)
|
||||
|
||||
//goose:provide
|
||||
func provideFooBar(fooer Fooer, bar *Bar) FooBar {
|
||||
return FooBar{fooer, bar}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
|
||||
package main
|
||||
|
||||
//goose:use provideBar
|
||||
//goose:use provideFooBar
|
||||
import (
|
||||
"codename/goose"
|
||||
)
|
||||
|
||||
func injectFooBar() FooBar
|
||||
func injectFooBar() FooBar {
|
||||
panic(goose.Use(
|
||||
provideBar,
|
||||
provideFooBar,
|
||||
goose.Bind(Fooer(nil), (*Bar)(nil))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user