alecthomas / gometalinter

DEPRECATED: Use https://github.com/golangci/golangci-lint
MIT License
3.51k stars 267 forks source link

Installing linters fails - what I'm doing wrong? #426

Closed arvenil closed 6 years ago

arvenil commented 6 years ago
$ go get -u github.com/alecthomas/gometalinter
$ gometalinter --install
Installing:
  deadcode
  dupl
  errcheck
  gas
  goconst
  gocyclo
  goimports
  golint
  gosimple
  gotype
  gotypex
  ineffassign
  interfacer
  lll
  maligned
  megacheck
  misspell
  nakedret
  safesql
  staticcheck
  structcheck
  unconvert
  unparam
  unused
  varcheck
  vet
can't load package: package github.com/walle/lll/cmd/lll: cannot find package "github.com/walle/lll/cmd/lll" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/walle/lll/cmd/lll (from $GOROOT)
        /Users/kdz/go/src/github.com/walle/lll/cmd/lll (from $GOPATH)
can't load package: package honnef.co/go/tools/cmd/unused: cannot find package "honnef.co/go/tools/cmd/unused" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/unused (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/unused (from $GOPATH)
can't load package: package github.com/kisielk/errcheck: cannot find package "github.com/kisielk/errcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/kisielk/errcheck (from $GOROOT)
        /Users/kdz/go/src/github.com/kisielk/errcheck (from $GOPATH)
can't load package: package github.com/gordonklaus/ineffassign: cannot find package "github.com/gordonklaus/ineffassign" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/gordonklaus/ineffassign (from $GOROOT)
        /Users/kdz/go/src/github.com/gordonklaus/ineffassign (from $GOPATH)
can't load package: package github.com/GoASTScanner/gas: cannot find package "github.com/GoASTScanner/gas" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/GoASTScanner/gas (from $GOROOT)
        /Users/kdz/go/src/github.com/GoASTScanner/gas (from $GOPATH)
can't load package: package github.com/opennota/check/cmd/varcheck: cannot find package "github.com/opennota/check/cmd/varcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/opennota/check/cmd/varcheck (from $GOROOT)
        /Users/kdz/go/src/github.com/opennota/check/cmd/varcheck (from $GOPATH)
can't load package: package github.com/mdempsky/unconvert: cannot find package "github.com/mdempsky/unconvert" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/mdempsky/unconvert (from $GOROOT)
        /Users/kdz/go/src/github.com/mdempsky/unconvert (from $GOPATH)
can't load package: package github.com/jgautheron/goconst/cmd/goconst: cannot find package "github.com/jgautheron/goconst/cmd/goconst" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/jgautheron/goconst/cmd/goconst (from $GOROOT)
        /Users/kdz/go/src/github.com/jgautheron/goconst/cmd/goconst (from $GOPATH)
can't load package: package github.com/golang/lint/golint: cannot find package "github.com/golang/lint/golint" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/golang/lint/golint (from $GOROOT)
        /Users/kdz/go/src/github.com/golang/lint/golint (from $GOPATH)
can't load package: package github.com/opennota/check/cmd/structcheck: cannot find package "github.com/opennota/check/cmd/structcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/opennota/check/cmd/structcheck (from $GOROOT)
        /Users/kdz/go/src/github.com/opennota/check/cmd/structcheck (from $GOPATH)
can't load package: package honnef.co/go/tools/cmd/megacheck: cannot find package "honnef.co/go/tools/cmd/megacheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/megacheck (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/megacheck (from $GOPATH)
can't load package: package github.com/client9/misspell/cmd/misspell: cannot find package "github.com/client9/misspell/cmd/misspell" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/client9/misspell/cmd/misspell (from $GOROOT)
        /Users/kdz/go/src/github.com/client9/misspell/cmd/misspell (from $GOPATH)
can't load package: package github.com/stripe/safesql: cannot find package "github.com/stripe/safesql" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/stripe/safesql (from $GOROOT)
        /Users/kdz/go/src/github.com/stripe/safesql (from $GOPATH)
can't load package: package github.com/tsenart/deadcode: cannot find package "github.com/tsenart/deadcode" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/tsenart/deadcode (from $GOROOT)
        /Users/kdz/go/src/github.com/tsenart/deadcode (from $GOPATH)
can't load package: package mvdan.cc/interfacer: cannot find package "mvdan.cc/interfacer" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/mvdan.cc/interfacer (from $GOROOT)
        /Users/kdz/go/src/mvdan.cc/interfacer (from $GOPATH)
can't load package: package github.com/alexkohler/nakedret: cannot find package "github.com/alexkohler/nakedret" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/alexkohler/nakedret (from $GOROOT)
        /Users/kdz/go/src/github.com/alexkohler/nakedret (from $GOPATH)
can't load package: package honnef.co/go/tools/cmd/staticcheck: cannot find package "honnef.co/go/tools/cmd/staticcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/staticcheck (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/staticcheck (from $GOPATH)
can't load package: package mvdan.cc/unparam: cannot find package "mvdan.cc/unparam" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/mvdan.cc/unparam (from $GOROOT)
        /Users/kdz/go/src/mvdan.cc/unparam (from $GOPATH)
can't load package: package github.com/mdempsky/maligned: cannot find package "github.com/mdempsky/maligned" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/mdempsky/maligned (from $GOROOT)
        /Users/kdz/go/src/github.com/mdempsky/maligned (from $GOPATH)
can't load package: package honnef.co/go/tools/cmd/gosimple: cannot find package "honnef.co/go/tools/cmd/gosimple" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/gosimple (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/gosimple (from $GOPATH)
can't load package: package github.com/dnephin/govet: cannot find package "github.com/dnephin/govet" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/dnephin/govet (from $GOROOT)
        /Users/kdz/go/src/github.com/dnephin/govet (from $GOPATH)
can't load package: package github.com/mibk/dupl: cannot find package "github.com/mibk/dupl" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/mibk/dupl (from $GOROOT)
        /Users/kdz/go/src/github.com/mibk/dupl (from $GOPATH)
can't load package: package github.com/alecthomas/gocyclo: cannot find package "github.com/alecthomas/gocyclo" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/alecthomas/gocyclo (from $GOROOT)
        /Users/kdz/go/src/github.com/alecthomas/gocyclo (from $GOPATH)
WARNING: failed to install one or more linters: exit status 1 (installing individually)
can't load package: package github.com/walle/lll/cmd/lll: cannot find package "github.com/walle/lll/cmd/lll" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/walle/lll/cmd/lll (from $GOROOT)
        /Users/kdz/go/src/github.com/walle/lll/cmd/lll (from $GOPATH)
WARNING: failed to install github.com/walle/lll/cmd/lll: exit status 1
can't load package: package honnef.co/go/tools/cmd/unused: cannot find package "honnef.co/go/tools/cmd/unused" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/unused (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/unused (from $GOPATH)
WARNING: failed to install honnef.co/go/tools/cmd/unused: exit status 1
can't load package: package github.com/kisielk/errcheck: cannot find package "github.com/kisielk/errcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/kisielk/errcheck (from $GOROOT)
        /Users/kdz/go/src/github.com/kisielk/errcheck (from $GOPATH)
WARNING: failed to install github.com/kisielk/errcheck: exit status 1
can't load package: package github.com/gordonklaus/ineffassign: cannot find package "github.com/gordonklaus/ineffassign" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/gordonklaus/ineffassign (from $GOROOT)
        /Users/kdz/go/src/github.com/gordonklaus/ineffassign (from $GOPATH)
WARNING: failed to install github.com/gordonklaus/ineffassign: exit status 1
can't load package: package github.com/GoASTScanner/gas: cannot find package "github.com/GoASTScanner/gas" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/GoASTScanner/gas (from $GOROOT)
        /Users/kdz/go/src/github.com/GoASTScanner/gas (from $GOPATH)
WARNING: failed to install github.com/GoASTScanner/gas: exit status 1
can't load package: package github.com/opennota/check/cmd/varcheck: cannot find package "github.com/opennota/check/cmd/varcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/opennota/check/cmd/varcheck (from $GOROOT)
        /Users/kdz/go/src/github.com/opennota/check/cmd/varcheck (from $GOPATH)
WARNING: failed to install github.com/opennota/check/cmd/varcheck: exit status 1
can't load package: package github.com/mdempsky/unconvert: cannot find package "github.com/mdempsky/unconvert" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/mdempsky/unconvert (from $GOROOT)
        /Users/kdz/go/src/github.com/mdempsky/unconvert (from $GOPATH)
WARNING: failed to install github.com/mdempsky/unconvert: exit status 1
can't load package: package github.com/jgautheron/goconst/cmd/goconst: cannot find package "github.com/jgautheron/goconst/cmd/goconst" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/jgautheron/goconst/cmd/goconst (from $GOROOT)
        /Users/kdz/go/src/github.com/jgautheron/goconst/cmd/goconst (from $GOPATH)
WARNING: failed to install github.com/jgautheron/goconst/cmd/goconst: exit status 1
can't load package: package github.com/golang/lint/golint: cannot find package "github.com/golang/lint/golint" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/golang/lint/golint (from $GOROOT)
        /Users/kdz/go/src/github.com/golang/lint/golint (from $GOPATH)
WARNING: failed to install github.com/golang/lint/golint: exit status 1
can't load package: package github.com/opennota/check/cmd/structcheck: cannot find package "github.com/opennota/check/cmd/structcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/opennota/check/cmd/structcheck (from $GOROOT)
        /Users/kdz/go/src/github.com/opennota/check/cmd/structcheck (from $GOPATH)
WARNING: failed to install github.com/opennota/check/cmd/structcheck: exit status 1
can't load package: package honnef.co/go/tools/cmd/megacheck: cannot find package "honnef.co/go/tools/cmd/megacheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/megacheck (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/megacheck (from $GOPATH)
WARNING: failed to install honnef.co/go/tools/cmd/megacheck: exit status 1
can't load package: package github.com/client9/misspell/cmd/misspell: cannot find package "github.com/client9/misspell/cmd/misspell" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/client9/misspell/cmd/misspell (from $GOROOT)
        /Users/kdz/go/src/github.com/client9/misspell/cmd/misspell (from $GOPATH)
WARNING: failed to install github.com/client9/misspell/cmd/misspell: exit status 1
can't load package: package github.com/stripe/safesql: cannot find package "github.com/stripe/safesql" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/stripe/safesql (from $GOROOT)
        /Users/kdz/go/src/github.com/stripe/safesql (from $GOPATH)
WARNING: failed to install github.com/stripe/safesql: exit status 1
can't load package: package github.com/tsenart/deadcode: cannot find package "github.com/tsenart/deadcode" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/tsenart/deadcode (from $GOROOT)
        /Users/kdz/go/src/github.com/tsenart/deadcode (from $GOPATH)
WARNING: failed to install github.com/tsenart/deadcode: exit status 1
can't load package: package mvdan.cc/interfacer: cannot find package "mvdan.cc/interfacer" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/mvdan.cc/interfacer (from $GOROOT)
        /Users/kdz/go/src/mvdan.cc/interfacer (from $GOPATH)
WARNING: failed to install mvdan.cc/interfacer: exit status 1
can't load package: package github.com/alexkohler/nakedret: cannot find package "github.com/alexkohler/nakedret" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/alexkohler/nakedret (from $GOROOT)
        /Users/kdz/go/src/github.com/alexkohler/nakedret (from $GOPATH)
WARNING: failed to install github.com/alexkohler/nakedret: exit status 1
can't load package: package honnef.co/go/tools/cmd/staticcheck: cannot find package "honnef.co/go/tools/cmd/staticcheck" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/staticcheck (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/staticcheck (from $GOPATH)
WARNING: failed to install honnef.co/go/tools/cmd/staticcheck: exit status 1
can't load package: package mvdan.cc/unparam: cannot find package "mvdan.cc/unparam" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/mvdan.cc/unparam (from $GOROOT)
        /Users/kdz/go/src/mvdan.cc/unparam (from $GOPATH)
WARNING: failed to install mvdan.cc/unparam: exit status 1
can't load package: package github.com/mdempsky/maligned: cannot find package "github.com/mdempsky/maligned" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/mdempsky/maligned (from $GOROOT)
        /Users/kdz/go/src/github.com/mdempsky/maligned (from $GOPATH)
WARNING: failed to install github.com/mdempsky/maligned: exit status 1
can't load package: package honnef.co/go/tools/cmd/gosimple: cannot find package "honnef.co/go/tools/cmd/gosimple" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/honnef.co/go/tools/cmd/gosimple (from $GOROOT)
        /Users/kdz/go/src/honnef.co/go/tools/cmd/gosimple (from $GOPATH)
WARNING: failed to install honnef.co/go/tools/cmd/gosimple: exit status 1
can't load package: package github.com/dnephin/govet: cannot find package "github.com/dnephin/govet" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/dnephin/govet (from $GOROOT)
        /Users/kdz/go/src/github.com/dnephin/govet (from $GOPATH)
WARNING: failed to install github.com/dnephin/govet: exit status 1
can't load package: package github.com/mibk/dupl: cannot find package "github.com/mibk/dupl" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/mibk/dupl (from $GOROOT)
        /Users/kdz/go/src/github.com/mibk/dupl (from $GOPATH)
WARNING: failed to install github.com/mibk/dupl: exit status 1
can't load package: package github.com/alecthomas/gocyclo: cannot find package "github.com/alecthomas/gocyclo" in any of:
        /Users/kdz/.gobrew/versions/1.9.2/src/github.com/alecthomas/gocyclo (from $GOROOT)
        /Users/kdz/go/src/github.com/alecthomas/gocyclo (from $GOPATH)
WARNING: failed to install github.com/alecthomas/gocyclo: exit status 1
gometalinter: error: failed to install the following linters: github.com/walle/lll/cmd/lll, honnef.co/go/tools/cmd/unused, github.com/kisielk/errcheck, github.com/gordonklaus/ineffassign, github.com/GoASTScanner/gas, github.com/opennota/check/cmd/varcheck, github.com/mdempsky/unconvert, github.com/jgautheron/goconst/cmd/goconst, github.com/golang/lint/golint, github.com/opennota/check/cmd/structcheck, honnef.co/go/tools/cmd/megacheck, github.com/client9/misspell/cmd/misspell, github.com/stripe/safesql, github.com/tsenart/deadcode, mvdan.cc/interfacer, github.com/alexkohler/nakedret, honnef.co/go/tools/cmd/staticcheck, mvdan.cc/unparam, github.com/mdempsky/maligned, honnef.co/go/tools/cmd/gosimple, github.com/dnephin/govet, github.com/mibk/dupl, github.com/alecthomas/gocyclo
dnephin commented 6 years ago

--install is supposed to adjust the GOPATH to ~/go/src/github.com/alecthomas/gometalinter/_linters and install them from the vendored copy, but from the error it doesn't look like that is happening.

You could try running with an explicit GOPATH:

export GOPATH=/Users/kdz/go/src/github.com/alecthomas/gometalinter/_linters

and also with --debug to see if that prints more info.

You could also try the binary install: https://github.com/alecthomas/gometalinter/releases

alecthomas commented 6 years ago

No response.

altanai commented 6 years ago

facing the same issue , have even set the gopath to pointe to the executable GOARCH="amd64" GOBIN="" GOCACHE="/Users/altanaibisht/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/altanaibisht/go/src/stats_service_api:/Users/altanaibisht/go:/Users/altanaibisht/go/src:/Users/altanaibisht/go/src/stats_service_api/bin/gometalinter" GORACE="" GOROOT="/usr/local/Cellar/go/1.10.3" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.10.3/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1g/mwm4v23x7tz3qfwsxtk9mcdr0000gn/T/go-build381288496=/tmp/go-build -gno-record-gcc-switches -fno-common"

debug logs : https://pastebin.com/k4DZEnFV