How do I install requirements in Go? "cannot find package"
You should install package first:
try
$ go get github.com/Sirupsen/logrus
and check you $GOPATH
dir
This project use gom
as the package manager,
Make sure you have installed gom
or try this command
$ gom install
I think your $GOPATH
and $PATH
settings are incorrect, the $GOPATH
environment variable specifies the location of your workspace, these are my path settings:
export GOROOT=$HOME/bin/go
export GOBIN=$GOROOT/bin
export GOPATH=$HOME/golang
export PATH=$PATH:$GOBIN
I had similar issue and
export GO111MODULE=on
helped.
Was able to fix the similar issue in Go 1.13.7 by typing:
export GOPATH=~/go
go get github.com/profile/repository
(e.g. github.com/Sirupsen/logrus)