xxpxxxxp / intellij-plugin-golangci-lint

GolangCI-Lint integration for IDEA
GNU General Public License v3.0
223 stars 14 forks source link

Project with empty GOPATH variable cannot execute plugins #125

Closed Lvzhenqian closed 2 years ago

Lvzhenqian commented 2 years ago
2022-09-16 16:59:47,486 [2165768]   WARN - go-linter - Debug command: cd /Users/charles/Documents/codes/micro-assist/blueking && export PATH=/Users/charles/sdk/go1.19/bin:/usr/bin:/bin:/usr/sbin:/sbin && export GOPATH= && export GO111MODULE=on && '/Users/charles/GOPATH/bin/golangci-lint' 'run' '--out-format' 'json' '--allow-parallel-runners' '-j' '2' '--issues-exit-code' '1' '--max-issues-per-linter' '0' '--max-same-issues' '0' '-c' '/Users/charles/Documents/codes/micro-assist/blueking/.golangci.yml' '.'

has GOPATH variable,like this:

image

not GOPATH variable,like this:

image

golangci-lint version: golangci-lint has version 1.49.0 built from cc2d97f3 on 2022-08-24T10:24:37Z

plugin version:

image

just add this can fix it ...

image
xxpxxxxp commented 2 years ago

Hi @Lvzhenqian , the plugin get GOPATH from IDE in such order:

  1. 全局GOPATH
  2. 项目GOPATH
  3. If this Use GOPATH that's defined in system environment is checked, get GOPATH from environment variable image

So please make sure at least 1 of them has no null value. In your case, I would suggest check theUse GOPATH that's defined in system environment