How to see Go compilations errors when building project in Go ?
Hello,
in Intellij, when I build my project in Java, I automatically see a list of compilation errors in a separate windows.
I use now Intellij + the Go plugin, and it does not do that. The closest behavior that I discovered is to open a terminal in Intellij and run a go linter.
Is there something more embedded like when you CTRL+F9 (build project) I've got what I had in Java ?
I also tried the “Problems” view, but it doesn't show any problems even if I rebuild the project
Thanks in advance
Please sign in to leave a comment.
Hi there Benoit Dupont ! Thank you for your question. Could you please share a couple of examples of the code that fails to compile in Java and Go so we could compare the two and see if we're able to highlight the necessary information in IntelliJ? Also, please share a screenshot of how errors are visible in IntelliJ when you compile Java code - this will also help me understand the case better.
Thank you!
I have the same question as the OP.
I am coming from a Java background and there, when using IntelliJ IDEA, all the present errors / issues can be shown either automatically, you we can “Rebuild” the project and if there were any issues they will be shown in the whole project. Aslo the related build tools, like Gradle or Maven, are nicely integrated and supported in the IDE.
Now in GoLand, for example, I have a situation when I removed one field form a struct and wanted to quickly see how it affected the whole project. I mean I thought there is some IDE provided command or setting to do that.
ATM I can you any of the following Go commands in my terminal to see any issues / errors:
Hi Levan Kekelidze ! That's a good point. I think you can automate the process you currently perform manually by installing and configuring the Go Linter plugin - https://plugins.jetbrains.com/plugin/12496-go-linter . Could you please give it a go and see if this works for you?
Hi, Vadim.
Tried this plug-in, set is as described on its GitHub page. Maybe I am missing something, but I haven't noticed any differences compared to the existing reporting of errors that is done by GoLand ("Problems" toolwindow).
I expected to see the configured linter report “on the fly” in some window / panel (we have a golangci-lint YAML config file). But anyways.
I have uninstalled it and for now will rely on the GoLand built-in error reporting and manually running the `golangci-lint run` command.
Thank you for checking this. Indeed, the suggestion I made is not exactly the same as the one you performed manually - those lints come up in the editor as an additional highlighting after the errors detected by the IDE are resolved. In case you wish to see the errors in a separate window, I'd suggest upvoting this case - GO-4618. It's a request to improve the current problem tools window. This is on our team's radar. I can't promise any ETAs at the moment, however, the more upvotes the topic gets, the easier it will be for us to estimate the demand for the changes and re-prioritize our work accordingly.
Thank you again and please let me know if there is anything else I can assist you with at the moment.
Vadym Veprytskyi
Upvoted the GO-4618.
Thank you for the detailed response 👍
I have no further questions ATM about this subject.