1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-02 11:57:47 +01:00
liquid/values
nsf 4354d48a04 Properly handle implicit conversion to integer types.
Go's reflect API is very picky about arguments to Call method. You can't just
pass in the "int" when function expects "int64", even on 64 bit machines. This
patch solves this problem by performing conversions properly. Truncation
problems however, as well as negative to uint issues are completely ignored.
Which is perhaps not ideal, but still better than returning "int" when "int32"
or "int64" is requested.

I did split the Kind switch cases and moved value -> int and value -> float
conversions to separate functions. An alternative to that would be using the
reflection API, which might be less performant. Not that it matters much, but
this solution is correct, even though looks a bit copy & pasty.

Oh and of course all "uint" types were completely missing in the function and
they are now added.
2018-05-31 23:18:57 +05:00
..
arrays.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
call_test.go Properly handle variadic functions. 2018-05-30 19:44:29 +05:00
call.go Properly handle variadic functions. 2018-05-30 19:44:29 +05:00
compare_test.go Nil pointers are equal, even if different types 2017-08-09 08:42:42 -04:00
compare.go Nil pointers are equal, even if different types 2017-08-09 08:42:42 -04:00
convert_test.go Properly handle implicit conversion to integer types. 2018-05-31 23:18:57 +05:00
convert.go Properly handle implicit conversion to integer types. 2018-05-31 23:18:57 +05:00
docs.go Package docs 2017-08-08 16:42:32 -04:00
drop_test.go Race test, benchmarks, for drop resolution 2017-08-03 15:20:56 +02:00
drop.go Actually cache the drop resolution 2017-08-03 15:20:56 +02:00
evaluator_test.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
mapslicevalue.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
parsedate_test.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
parsedate.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
predicates_test.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
predicates.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
range.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
sort.go Move pkg evaluator -> values 2017-07-27 18:11:37 -04:00
structvalue_test.go Fix struct PropertyValue attempting to use an invalid pointer 2017-08-01 11:27:32 +10:00
structvalue.go variable names 2017-08-23 15:56:18 -04:00
value_test.go map[unhashable] returns nil instead of panic 2017-08-23 16:03:46 -04:00
value.go map[unhashable] returns nil instead of panic 2017-08-23 16:03:46 -04:00