Using goland with autogenerated code, ignoring analysis of generated code

I'm trying to start using google's dependency injection framework 'wire'. It uses go's build constraints '//+build wireinject' to exclude the file from the build and it generates a file with the same method names.

 

This works fine from the command line but there's a compile error in goland about a duplicate function in the same package. I'm wondering if there is any way to get this compile error to go away from goland.

1 comment

It depends on what you mean by compilng error. If you mean output of running – literally error that comes from compiler – you can add or remove needed build tags in the run configuration you're trying to run (Run | Edit configurations...).

If you mean error that GoLand shows in the editor, than you need to add or delete needed build tags in GoLand settings, to let it know what files it should ignore. See `File | Settings | Go | Build Tags & Vendoring`. 

That's all I can say based on the provided information. You can append it with more details and screenshots.

0

Please sign in to leave a comment.