From 89cb901fdf9dfcf4292cbfe0c9ac90d98213be68 Mon Sep 17 00:00:00 2001 From: shantuo Date: Mon, 17 Jun 2019 17:27:07 -0700 Subject: [PATCH] document wire.Struct first argument (#197) --- wire.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wire.go b/wire.go index ea2479c8..941d6c65 100644 --- a/wire.go +++ b/wire.go @@ -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: