go-enry / go-license-detector

Reliable project licenses detector.
Other
127 stars 36 forks source link

command not found error when trying to run cli command #11

Closed albert-csms closed 3 years ago

albert-csms commented 3 years ago

I am trying to download and run license-detector

❯ go clean --modcache                                                                                                                                    
❯ go get github.com/go-enry/go-license-detector/v4/licensedb                                                                                             go: downloading github.com/go-enry/go-license-detector v0.0.0-20200530180532-d686c4b71e84
go: downloading github.com/go-enry/go-license-detector/v4 v4.1.1
go: downloading github.com/go-git/go-git/v5 v5.1.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/ekzhu/minhash-lsh v0.0.0-20171225071031-5c06ee8586a1
go: downloading github.com/jdkato/prose v1.1.0
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading golang.org/x/text v0.3.2
go: downloading github.com/hhatto/gorst v0.0.0-20181029133204-ca9f730cac5b
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading golang.org/x/net v0.0.0-20200301022130-244492dfa37a
go: downloading golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2
go: downloading gonum.org/v1/gonum v0.7.0
go: downloading github.com/dgryski/go-minhash v0.0.0-20170608043002-7fe510aff544
go: downloading github.com/emirpasic/gods v1.12.0
go: downloading golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
go: downloading github.com/go-git/go-billy/v5 v5.0.0
go: downloading github.com/imdario/mergo v0.3.9
go: downloading github.com/montanaflynn/stats v0.0.0-20151014174947-eeaced052adb
go: downloading github.com/shogo82148/go-shuffle v0.0.0-20170808115208-59829097ff3b
go: downloading gopkg.in/neurosnap/sentences.v1 v1.0.6
go: downloading github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: downloading golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
go: downloading github.com/go-git/gcfg v1.5.0
go: downloading github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd
go: downloading github.com/xanzy/ssh-agent v0.2.1
go: downloading gopkg.in/warnings.v0 v0.1.2

However, when I cd in to ~/go/src/github.com, I do not see go-enry. When I run license-detector, I get

zsh: command not found: license-detector

This is at the bottom of my .zshrc file:

export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

echo $PATH gives

/Users/my.name/.serverless/bin:/Users/my.name/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/my.name/go/bin

go env gives:

GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/my.name/go/bin"
GOCACHE="/Users/my.name/Library/Caches/go-build"
GOENV="/Users/my.name/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/my.name/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/my.name/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0k/vkq6ycws5sg73j7lpgcd2z680000gn/T/go-build702706474=/tmp/go-build -gno-record-gcc-switches -fno-common"

How do I get the CLI command to run?

bzz commented 3 years ago

Try

go get github.com/go-enry/go-license-detector/v4/cmd/license-detector@v4.1.1
file ~/go/bin/license-detector

Sorry, the documentation seems to be out of date but PRs to improve it are welcome ;)

bzz commented 3 years ago

closing, assuming it's resolved now