~~~golang
var (
_ ConnWithTimeout = (*conn)(nil)
)
~~~
[原代码链接](https://github.com/gomodule/redigo/blob/master/redis/conn.go#L33)
看 [redigo](github.com/gomodule/redigo) 源码,发现文件开头定义了个 `_` 只读的变量,一头懵~~
求助:作者为啥这么写?
cannot use (*conn)(nil) (type *conn) as type ConnWithTimeout in assignment:
*conn does not implement ConnWithTimeout (wrong type for Do method)
have Do(string, ...interface {}) (interface {}, error)
want Do(string) 是不是reids源码有问题 怎么解决的
#7
更多评论