We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wonder why there is no convenient methods for each redis command.
For instance instead of :
values, err := redis.Values(conn.Do("HGETALL", sym)) if err != nil { log.Fatal(err) } var stock Stock if err := redis.ScanStruct(values, &stock); err != nil { log.Fatal(err) }
It would be nice to have :
var stock Stock if err := conn.Hgetall("key", &stock); err!= nil { log.Fatal(err) }
With the following naive implementation :
func (c *Conn) Hgetall(key string, data interface{}) error { values, err := redis.Values(conn.Do("HGETALL", key)) if err != nil { return err } if err := redis.ScanStruct(values, data); err != nil { return err } return nil }
The implementation could be improved with the detection of data type and so invoking the corresponding Scan* function.
Scan*
The text was updated successfully, but these errors were encountered:
I did not add convenience functions for the following reasons:
Sorry, something went wrong.
Thanks for the explanation
garyburd
No branches or pull requests
I wonder why there is no convenient methods for each redis command.
For instance instead of :
It would be nice to have :
With the following naive implementation :
The implementation could be improved with the detection of data type and so invoking the corresponding
Scan*
function.The text was updated successfully, but these errors were encountered: