wire: store value expressions in package variables (google/go-cloud#135)
The code assigns a local unnecessarily, but this should have no appreciable effect on semantics, just readability. Fixes google/go-cloud#104
This commit is contained in:
@@ -304,9 +304,10 @@ func injectFoo() Foo {
|
||||
}
|
||||
```
|
||||
|
||||
It's important to note that the expression will be copied, so references to
|
||||
variables will be evaluated during the call to the injector. `gowire` will emit
|
||||
an error if the expression calls any functions.
|
||||
It's important to note that the expression will be copied to the injector's
|
||||
package; references to variables will be evaluated during the injector
|
||||
package's initialization. `gowire` will emit an error if the expression calls
|
||||
any functions or receives from any channels.
|
||||
|
||||
### Cleanup functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user