google / wire

Compile-time Dependency Injection for Go
Apache License 2.0
13.14k stars 625 forks source link

[Feat] [Issue-185] do not use global variables for all wire.Value expressions #397

Open ProgrammingMuffin opened 11 months ago

ProgrammingMuffin commented 11 months ago

Fixes Issue-185

Previously, wire used to generate global variables and inject them in place of wire.Value(..) but now it won't create global variables at all and instead puts the value directly from source.

Source: image

Generated: image

google-cla[bot] commented 11 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

ProgrammingMuffin commented 11 months ago

testdata/VarValue fails due to program output related problems.

This might be that one edge case where the replaced value is wrong.

ProgrammingMuffin commented 9 months ago

@zombiezen could you please take a look at this PR? Thank you