golint support for JetBrains GoLand
I'm using GoLand IDE for developing Go applications. I decided to use this as lots of things worked out of the box and I'm used to JetBrains IDEs (Android Studio, AppCode, IntelliJ) and I feel very effective with the learned keyboard shortcuts.
Today, I wanted to enable golint on the project I'm working on, however, I didn't find any standard, simple way to add golint to GoLand.
How can I have the linter go through my code and display a warning or error in JetBrains GoLand? I don't want to rely on the command-line tool to execute the command every time, I want to have it in the editor.
Based on the golint output, it seems like it should not be too hard to integrate the output (it includes the file path, line, column, and the error in each line) and display it as an error right in the editor (with the little red lamp).
I followed the only guide I found, Configure GoLand with golint, but unfortunately, I don't consider it a good enough solution. The end result of that tutorial is that the IDE opens a "console" at the bottom of the page, and it just outputs the command result in the IDE. I want to find a way to include it within my code.
请先登录再写评论。
Hello,
Most inspections included in the IDE by default, but some disabled (Preferences / Settings | Editor | Inspections | Go). Please check it, possibly you can find inspections that would be useful for you.
I assume that you enable File Watcher that is called golangci-lint. Currently, these inspections not available as built-in in the code, feel free to go to GO-2220 and vote for it to stay updated.
By the way, pay attention that golint disabled by default in golangci-lint.
I'd like to add to the above that golint is officially deprecated, for details see: https://github.com/golang/go/issues/38968
Please, pay attention to the 3rd-party plugin Go Linter. It supports golint and other linters with built-in inspections.