Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to solve "redeclare in this package "after generate #348

Open
whybangbang opened this issue Mar 13, 2022 · 2 comments
Open

how to solve "redeclare in this package "after generate #348

whybangbang opened this issue Mar 13, 2022 · 2 comments
Labels
needs info Further discussion or clarification is necessary

Comments

@whybangbang
Copy link

after command "wire" execute, duplicate funciton name will exist in a same package, for example "InitializeApi"
how to solve, thx
image

@jayzhuang jayzhuang added the needs info Further discussion or clarification is necessary label Apr 17, 2022
@jayzhuang
Copy link
Collaborator

Did you put the build constraints in wire.go? For example see

wire/_tutorial/wire.go

Lines 15 to 16 in 9d78e0a

//go:build wireinject
// +build wireinject

If this doesn't work, can you provide a more detailed repro step? e.g. What does your source look like, and what command did you run that tells you "redeclare in this package". Thanks!

@raza-basit
Copy link

@whybangbang don't forget the add trailing line

//go:build wireinject 
 // +build wireinject 

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Further discussion or clarification is necessary
Projects
None yet
Development

No branches or pull requests

3 participants