1 Star 0 Fork 0

李光春 / go-redis

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Iterator.go 384 Bytes
一键复制 编辑 原始数据 按行查看 历史
李光春 提交于 2021-07-14 00:42 . 增加序列化方式
package dredis
type Iterator struct {
data []interface{}
index int
}
func NewIterator(data []interface{}) *Iterator {
return &Iterator{data: data}
}
func (i *Iterator) HasNext() bool {
if i.data == nil || len(i.data) == 0 {
return false
}
return i.index < len(i.data)
}
func (i *Iterator) Next() (Ret interface{}) {
Ret = i.data[i.index]
i.index = i.index + 1
return
}
1
https://gitee.com/dtapps/go-redis.git
git@gitee.com:dtapps/go-redis.git
dtapps
go-redis
go-redis
v1.0.3

搜索帮助