goose: add optional provider inputs
Reviewed-by: Tuo Shan <shantuo@google.com>
This commit is contained in:
16
internal/goose/testdata/OptionalPresent/foo/foo.go
vendored
Normal file
16
internal/goose/testdata/OptionalPresent/foo/foo.go
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println(injectBar(42))
|
||||
}
|
||||
|
||||
type foo int
|
||||
type bar int
|
||||
|
||||
//goose:provide
|
||||
//goose:optional f
|
||||
func provideBar(f foo) bar {
|
||||
return bar(f)
|
||||
}
|
||||
Reference in New Issue
Block a user