Skip to content

Commit

Permalink
return raw value instead of funcation calling in Result()
Browse files Browse the repository at this point in the history
Signed-off-by: lowang-bh <lhui_wang@163.com>
  • Loading branch information
lowang-bh committed Dec 12, 2023
1 parent a109302 commit f1c241f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions command.go
Expand Up @@ -845,7 +845,7 @@ func (cmd *StringCmd) Val() string {
}

func (cmd *StringCmd) Result() (string, error) {
return cmd.Val(), cmd.err
return cmd.val, cmd.err
}

func (cmd *StringCmd) Bytes() ([]byte, error) {
Expand Down Expand Up @@ -949,7 +949,7 @@ func (cmd *FloatCmd) Val() float64 {
}

func (cmd *FloatCmd) Result() (float64, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *FloatCmd) String() string {
Expand Down Expand Up @@ -1044,7 +1044,7 @@ func (cmd *StringSliceCmd) Val() []string {
}

func (cmd *StringSliceCmd) Result() ([]string, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *StringSliceCmd) String() string {
Expand Down Expand Up @@ -2706,7 +2706,7 @@ func (cmd *ZWithKeyCmd) Val() *ZWithKey {
}

func (cmd *ZWithKeyCmd) Result() (*ZWithKey, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *ZWithKeyCmd) String() string {
Expand Down Expand Up @@ -2844,7 +2844,7 @@ func (cmd *ClusterSlotsCmd) Val() []ClusterSlot {
}

func (cmd *ClusterSlotsCmd) Result() ([]ClusterSlot, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *ClusterSlotsCmd) String() string {
Expand Down Expand Up @@ -3304,7 +3304,7 @@ func (cmd *GeoPosCmd) Val() []*GeoPos {
}

func (cmd *GeoPosCmd) Result() ([]*GeoPos, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *GeoPosCmd) String() string {
Expand Down Expand Up @@ -3385,7 +3385,7 @@ func (cmd *CommandsInfoCmd) Val() map[string]*CommandInfo {
}

func (cmd *CommandsInfoCmd) Result() (map[string]*CommandInfo, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *CommandsInfoCmd) String() string {
Expand Down Expand Up @@ -3575,7 +3575,7 @@ func (cmd *SlowLogCmd) Val() []SlowLog {
}

func (cmd *SlowLogCmd) Result() ([]SlowLog, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *SlowLogCmd) String() string {
Expand Down Expand Up @@ -3674,7 +3674,7 @@ func (cmd *MapStringInterfaceCmd) Val() map[string]interface{} {
}

func (cmd *MapStringInterfaceCmd) Result() (map[string]interface{}, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *MapStringInterfaceCmd) String() string {
Expand Down Expand Up @@ -3738,7 +3738,7 @@ func (cmd *MapStringStringSliceCmd) Val() []map[string]string {
}

func (cmd *MapStringStringSliceCmd) Result() ([]map[string]string, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *MapStringStringSliceCmd) String() string {
Expand Down Expand Up @@ -3802,7 +3802,7 @@ func (cmd *MapStringInterfaceSliceCmd) Val() []map[string]interface{} {
}

func (cmd *MapStringInterfaceSliceCmd) Result() ([]map[string]interface{}, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *MapStringInterfaceSliceCmd) String() string {
Expand Down Expand Up @@ -4652,7 +4652,7 @@ func (cmd *ClusterLinksCmd) Val() []ClusterLink {
}

func (cmd *ClusterLinksCmd) Result() ([]ClusterLink, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *ClusterLinksCmd) String() string {
Expand Down Expand Up @@ -4754,7 +4754,7 @@ func (cmd *ClusterShardsCmd) Val() []ClusterShard {
}

func (cmd *ClusterShardsCmd) Result() ([]ClusterShard, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *ClusterShardsCmd) String() string {
Expand Down Expand Up @@ -5227,7 +5227,7 @@ func (cmd *ACLLogCmd) Val() []*ACLLogEntry {
}

func (cmd *ACLLogCmd) Result() ([]*ACLLogEntry, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *ACLLogCmd) String() string {
Expand Down Expand Up @@ -5328,7 +5328,7 @@ func (cmd *InfoCmd) Val() map[string]map[string]string {
}

func (cmd *InfoCmd) Result() (map[string]map[string]string, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *InfoCmd) String() string {
Expand Down
4 changes: 2 additions & 2 deletions json.go
Expand Up @@ -182,7 +182,7 @@ func (cmd *JSONSliceCmd) Val() []interface{} {
}

func (cmd *JSONSliceCmd) Result() ([]interface{}, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *JSONSliceCmd) readReply(rd *proto.Reader) error {
Expand Down Expand Up @@ -258,7 +258,7 @@ func (cmd *IntPointerSliceCmd) Val() []*int64 {
}

func (cmd *IntPointerSliceCmd) Result() ([]*int64, error) {
return cmd.Val(), cmd.Err()
return cmd.val, cmd.err
}

func (cmd *IntPointerSliceCmd) readReply(rd *proto.Reader) error {
Expand Down

0 comments on commit f1c241f

Please sign in to comment.