Logo
Explore Help
Register Sign In
admin/wire
1
0
Fork 0
You've already forked wire
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
f8e446fa171d18bfd430d7d292d096eeb63cb451
wire/internal/goose/testdata/NoImplicitInterface/foo/foo.go

22 lines
235 B
Go
Raw Normal View History

goose: add interface binding An interface binding instructs goose that a concrete type should be used to satisfy a dependency on an interface type. goose could determine this implicitly, but having an explicit directive makes the provider author's intent clear and allows different concrete types to satisfy different smaller interfaces. Reviewed-by: Tuo Shan <shantuo@google.com>
2018-04-02 14:08:17 -07:00
package main
import "fmt"
func main() {
fmt.Println(injectFooer().Foo())
}
type Fooer interface {
Foo() string
}
type Bar string
func (b Bar) Foo() string {
return string(b)
}
func provideBar() Bar {
return "Hello, World!"
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 33ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API