DisposaBoy / GoSublime

A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.
MIT License
3.42k stars 302 forks source link

Not sure 'golint' is running upon save #524

Closed vastbinderj closed 5 years ago

vastbinderj commented 10 years ago

When I lint upon save in VIM using syntastic and golint, I see every potential error I'd get if I were to run go build. I am not seeing any lint or potential build errors in Sublime Text3 with GoSublime version r13.12.26-3. cmd-.,cmd-e brings up the error window, but I don't see the errors I see in vim on the same files. Have I not set this up correctly? Or is the expectation that I will run go build in the 9o panel?

I've followed the notes on setting this up and even added :

GoSublime.sublime-settings

 {
   // enable comp-lint, this will effectively disable the live linter
   "comp_lint_enabled": true,

   // list of commands to run
   "comp_lint_commands": [
   // run `golint` on all files in the package
   // "shell":true is required in order to run the command through your shell (to expand `*.go`)
   // also see: the documentation for the `shell` setting in the default settings file ctrl+dot,ctrl+4
   {"cmd": ["golint *.go"], "shell": true},

   // run go vet on the package
   // {"cmd": ["go", "vet"]},

   // run go build
   {"cmd": ["go", "build"]}

   // run `go install` on the package. GOBIN is set,
   // so `main` packages shouldn't result in the installation of a binary
   // {"cmd": ["go", "install"]}
 ],

 "on_save": [
   // run comp-lint when you save,
   // naturally, you can also bind this command `gs_comp_lint`
   // to a key binding if you want
   {"cmd": "gs_comp_lint"}
 ]
}

Notice the gutter marks indicating a linting error, but the error drop down is blank: gosublime

vastbinderj commented 10 years ago

After watching this as I code today, I'm realizing that golint is actually working now and the circle gutter marks are being created.

There is also a corresponding message in the bottom status bar, but the error drop down is not being populated as expected.

DisposaBoy commented 10 years ago

I'm guessing that the quick panel doesn't understand comp-lint, I can't remember... but all that is gone in https://github.com/DisposaBoy/GoSublime-next anyway so I don't think it's worth fixing at this point