My environment is go1.17.2 Windows AMD64
with go env GO111MODULE=on
.
I add import "github.com/go-redis/redis/v8"
in my code. I execute go install github.com/go-redis/redis/v8@latest
, but the result is package github.com/go-redis/redis/v8 is not a main package
.
And when I execute go run main.go
, it shows cannot find package
at the line of import github.com/go-redis/redis/v8
.
What's wrong of my operations or the config of environment?
Content of go.mod
(with simple go mod init
& go mod tidy
):
module ...
go 1.17
require github.com/go-redis/redis/v8 v8.11.4
require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
)
go.mod
? – Burnsides