revert gvar.Var from interface to struct

This commit is contained in:
John
2020-06-29 13:40:19 +08:00
parent 09eba58927
commit 46bdde9265
37 changed files with 351 additions and 451 deletions

View File

@ -173,7 +173,7 @@ type Link interface {
type (
// Value is the field value type.
Value = gvar.Var
Value = *gvar.Var
// Record is the row record of the table.
Record map[string]Value

View File

@ -211,7 +211,7 @@ func (r *Redis) Do(command string, args ...interface{}) (interface{}, error) {
}
// DoVar returns value from Do as gvar.Var.
func (r *Redis) DoVar(command string, args ...interface{}) (gvar.Var, error) {
func (r *Redis) DoVar(command string, args ...interface{}) (*gvar.Var, error) {
v, err := r.Do(command, args...)
if result, ok := v.([]byte); ok {
return gvar.New(gconv.UnsafeBytesToStr(result)), err

View File

@ -44,13 +44,13 @@ func (c *Conn) Do(commandName string, args ...interface{}) (reply interface{}, e
}
// DoVar retrieves and returns the result from command as gvar.Var.
func (c *Conn) DoVar(command string, args ...interface{}) (gvar.Var, error) {
func (c *Conn) DoVar(command string, args ...interface{}) (*gvar.Var, error) {
v, err := c.Do(command, args...)
return gvar.New(v), err
}
// ReceiveVar receives a single reply as gvar.Var from the Redis server.
func (c *Conn) ReceiveVar() (gvar.Var, error) {
func (c *Conn) ReceiveVar() (*gvar.Var, error) {
v, err := c.Receive()
return gvar.New(v), err
}