google / wire

Compile-time Dependency Injection for Go
Apache License 2.0
13.05k stars 622 forks source link

I can't use the init function which from my wire.go in my main.go #378

Open tudoutiaoya opened 1 year ago

tudoutiaoya commented 1 year ago

image here, I used four struct, and I define a init function in my wire.go , but the question is I can't use it in my main.go

geret13 commented 1 year ago

Hey @tudoutiaoya, could you show me your wire_gen.go? It seems like your IDE is using that for its analysis.

shuqingzai commented 1 year ago

remove wire plugin from ide, it's useless and cause IDE error

lupguo commented 1 year ago
image

Firstly, add wireinject to your custom tags. Next, run go get github.com/google/wire. Once this is done, Jetbrains Goland will analyze your code success.