redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Apache License 2.0
2.47k stars 158 forks source link

Support iter.Seq2 for *FieldValue #625

Closed tamayika closed 2 months ago

tamayika commented 2 months ago

closes #355

I added iter.Seq2 support for HSET, HMSET, XADD which have FieldValue() method. We must support < go 1.23, so we must split file to other files. It's hard to support auto generation because current implementation does not support code splitting. So I hand-written the implementation. When go version in go.mod is go 1.23, I think we can support auto generation by adding flags to *.json and its structs.

Consideration

I named FieldValues, but this is maybe not good to support auto generation in the future because we must consider plural form correctly. Is FieldValueSeq better?

rueian commented 2 months ago

Is FieldValueSeq better?

I think your original FieldValueIter is better.