func (aft *arrayFindTemplate) handle(tran *trans.Transaction, action *trans.Action, reply interface{}) { replies, err := redis.Values(reply, nil) if err != nil { panic(err) } for _, rpy := range replies { newAs := make([]*trans.Action, 0, 1) aft.elemTpl.Engrave(&newAs, rpy) action.AddChildren(newAs...) tran.Actions = append(tran.Actions, newAs...) } }
func (sft *structFindTemplate) handle(tran *trans.Transaction, action *trans.Action, reply interface{}) { replies, err := redis.Values(reply, nil) if err != nil { panic(err) } toggle := false for i, rpy := range replies { toggle = !toggle if toggle { continue } newAs := make([]*trans.Action, 0, 1) sft.elemTpl[(i-1)/2].Engrave(&newAs, rpy) action.AddChildren(newAs...) tran.Actions = append(tran.Actions, newAs...) } }