wire: allow wire.Value to use values with no parent (i.e., struct fields) (google/go-cloud#596)

This commit is contained in:
Robert van Gent
2018-11-02 13:58:15 -07:00
committed by Ross Light
parent b4218146b9
commit ab113bf8d1
13 changed files with 152 additions and 2 deletions

View File

@@ -327,9 +327,13 @@ The generated injector would look like this:
```go
func injectFoo() Foo {
foo := Foo{X: 42}
foo := _wireFooValue
return foo
}
var (
_wireFooValue = Foo{X: 42}
)
```
It's important to note that the expression will be copied to the injector's