Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

redigomock

> 编程语言
Open source

Easy way to unit test projects using redigo library (Redis client in go)

199 stars0 likes1 views
WebsiteGitHub

About

Easy way to unit test projects using redigo library (Redis client in go)

redigomock

Easy way to unit test projects using redigo library (Redis client in go). You can find the latest release here.

install

go get -u github.com/rafaeljusto/redigomock/v3

usage

Here is an example of using redigomock, for more information please check the API documentation.

…

mocking a subscription

…

connections pool

go
// Note you cannot get access to the connection via the pool,
// the only way is to use this conn variable.
conn := redigomock.NewConn()
pool := &redis.Pool{
	// Return the same connection mock for each Get() call.
	Dial:    func() (redis.Conn, error) { return conn, nil },
	MaxIdle: 10,
}

dynamic handling arguments

Sometimes you need to check the executed arguments in your Redis command. For that you can use the command handler.

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言