I downloaded go-redis client using
go mod init github.com/my/repo
go get github.com/go-redis/redis/v8
But it showed cannot find package "go.opentelemetry.io/otel/api/trace". So I deleted go-redis from ${GOPATH}/src/github.com and then tried running it again
go get github.com/go-redis/redis/v8
But it does nothing. Doesn't show any error or any message. But when I try to import package it says
cannot find package "github.com/go-redis/redis/v8" in any of:
ā/usr/lib/go/src/github.com/go-redis/redis/v8 (from $GOROOT)
ā/home/username/go/src/github.com/go-redis/redis/v8 (from $GOPATH)
I tried go mod tidy
go mod clean
but none worked. What should I do?
$GOPATH
, if is not showing your path of golang library source, you should set path first,go mod tidy
tidy argument make you doing download package with sync method, without doing go get separately.