goose: require pointer for first argument to goose.Bind (google/go-cloud#31)
Fixes google/go-cloud#15
This commit is contained in:
5
goose.go
5
goose.go
@@ -43,11 +43,12 @@ func Build(...interface{}) string {
|
||||
type Binding struct{}
|
||||
|
||||
// Bind declares that a concrete type should be used to satisfy a
|
||||
// dependency on iface.
|
||||
// dependency on the type of iface, which must be a pointer to an
|
||||
// interface type.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// var MySet = goose.NewSet(goose.Bind(MyInterface(nil), new(MyStruct)))
|
||||
// var MySet = goose.NewSet(goose.Bind(new(MyInterface), new(MyStruct)))
|
||||
func Bind(iface, to interface{}) Binding {
|
||||
return Binding{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user