cannot find package "github.com/go-redis/redis/v8"

83 views
Skip to first unread message

Aadi Sharma

unread,
Sep 18, 2023, 6:27:09 AM9/18/23
to golang-nuts
I am using go-redis package and can not use it's any version without mod file.
Do golang does not allow us to  use this package without mod file ? 
I use  
 but with none of these three comands i was not able to import the redis package.
On the other hand i  use to import this package with the presence of mod file and
it get's imported.
How to use this package without any mod file....



With regards
Aadi

Brian Candler

unread,
Sep 18, 2023, 8:20:05 AM9/18/23
to golang-nuts
You always need a go.mod file if you are importing other modules. But if you're not publishing your code, you can name your own module however you like: "go mod init example" is fine.
Reply all
Reply to author
Forward
0 new messages