简体   繁体   English

Go + Redis - 教程入门不起作用

[英]Go + Redis - Tutorial Get Started doesn't work

Hi,你好,

I have made several redis and go tutorial sites.我制作了几个 redis 和 go 教程网站。 Most of the pages don't work.大多数页面都不起作用。 Here's a very simple one that doesn't work.这是一个非常简单但不起作用的方法。

https://developer.redis.com/develop/golang/ 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?你用的是什么版本的 go-redis? In version 8 it should work.在版本 8 中它应该可以工作。 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请参阅此示例代码以了解如何使用它: 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.检查最新版本和使用情况的(github)存储库通常会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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