فهرست منبع

Minor refactoring to make it clearer to see what is going on with this reflection

Ben Hood 11 سال پیش
والد
کامیت
65ecc5f847
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      cassandra_test.go

+ 3 - 1
cassandra_test.go

@@ -604,7 +604,9 @@ func (kv *ClusteredKeyValue) Bind(q *QueryInfo) []interface{} {
 
 	for i, info := range q.args {
 		fieldName := upcaseInitial(info.Name)
-		values[i] = reflect.Indirect(reflect.ValueOf(kv)).FieldByName(fieldName).Addr().Interface()
+		value := reflect.ValueOf(kv)
+		field := reflect.Indirect(value).FieldByName(fieldName)
+		values[i] = field.Addr().Interface()
 	}
 
 	return values