Registry / database / redis-go-redis-v9

redis-go-redis-v9

JSON →
library9.20.1gogounverified

Package redis implements a Redis client for Go.

go get github.com/redis/go-redis/v9
INSTALL
IMPORT
SIG · REDIS-GO-REDIS-V9
R
redis-go-redis-v9
databasegov9.20.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

redis
github.com/redis/go-redis/v9

Connects to Redis, sets a key, and retrieves it.

package main import ( "context" "fmt" "github.com/redis/go-redis/v9" ) func main() { ctx := context.Background() rdb := redis.NewClient(&redis.Options{Addr: "localhost:6379"}) err := rdb.Set(ctx, "key", "value", 0).Err() if err != nil { panic(err) } val, err := rdb.Get(ctx, "key").Result() if err != nil { panic(err) } fmt.Println("key", val) }
Debug
Known issues
breakingv9 has breaking API changes from v8, including context requirement for all commands.
fix
Update imports from github.com/go-redis/redis to github.com/redis/go-redis/v9 and pass context to all commands.
affects: >=9.0.0
Upgrade
Version history
9.20.1latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Meta
1
Resources
redis-go-redis-v9 — go get redis-go-redis-v9 · libregistry