简体   繁体   中英

Go + Redis - Tutorial Get Started doesn't work

Hi,

I have made several redis and go tutorial sites. Most of the pages don't work. Here's a very simple one that doesn't work.

https://developer.redis.com/develop/golang/

And here is the error message.

# command-line-arguments
./main.go:17:29: too many arguments in call to client.cmdable.Ping
    have (context.Context)
    want ()

How to make the tutorial work?

What version of go-redis are you using? In version 8 it should work. github.com/go-redis/redis/v8

See this example code on how to use it: https://github.com/go-redis/redis/blob/master/example_test.go

It usually helps to check out the (github) repository fo the lastest version and usage.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM