document wire.Struct first argument (#197)

This commit is contained in:
shantuo
2019-06-17 17:27:07 -07:00
committed by GitHub
parent 93b1ce745f
commit 89cb901fdf

View File

@@ -146,9 +146,11 @@ func InterfaceValue(typ interface{}, x interface{}) ProvidedValue {
// A StructProvider represents a named struct.
type StructProvider struct{}
// Struct specifies that the given struct type will be provided by filling in the fields
// in the struct that have the names given. Each of the arguments must be a name
// to the field they wish to reference. As a special case, if a single name "*"
// Struct specifies that the given struct type will be provided by filling in the fields in the struct that have the names given.
//
// The first argument must be a pointer to the struct type. For a struct type
// Foo, Wire will use field-filling to provide both Foo and *Foo. The remaining
// arguments are field names to fill in. As a special case, if a single name "*"
// is given, then all of the fields in the struct will be filled in.
//
// For example: