Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 89cb901

Browse files
authored
document wire.Struct first argument (#197)
1 parent 93b1ce7 commit 89cb901

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

wire.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ func InterfaceValue(typ interface{}, x interface{}) ProvidedValue {
146146
// A StructProvider represents a named struct.
147147
type StructProvider struct{}
148148

149-
// Struct specifies that the given struct type will be provided by filling in the fields
150-
// in the struct that have the names given. Each of the arguments must be a name
151-
// to the field they wish to reference. As a special case, if a single name "*"
149+
// Struct specifies that the given struct type will be provided by filling in the fields in the struct that have the names given.
150+
//
151+
// The first argument must be a pointer to the struct type. For a struct type
152+
// Foo, Wire will use field-filling to provide both Foo and *Foo. The remaining
153+
// arguments are field names to fill in. As a special case, if a single name "*"
152154
// is given, then all of the fields in the struct will be filled in.
153155
//
154156
// For example:

0 commit comments

Comments
 (0)