Currently Rudi works only/best with pure map[string]any, generic datastructures. However it would be nice if one could also just use any kind of Go struct, similar to how Go templates also allow to access fields in structs using reflection.
Structs can of course contain pointer fields and those must be taken care of separately, as most funtions in Rudi do not take pointers (like concat), but Rudi also offers no language elements to dereference a pointer, nor do I intend to add such language elements. My plan is to automatically dereference pointers when evaluating a JSON path, so that if a field is nil, nil is returned, otherwise the dereferenced value.
In general, pointers are discouraged in Rudi and can lead to many hard to troubleshoot side effects. Support for them is on a best effort basis.
Currently Rudi works only/best with pure
map[string]any
, generic datastructures. However it would be nice if one could also just use any kind of Go struct, similar to how Go templates also allow to access fields in structs using reflection.Structs can of course contain pointer fields and those must be taken care of separately, as most funtions in Rudi do not take pointers (like
concat
), but Rudi also offers no language elements to dereference a pointer, nor do I intend to add such language elements. My plan is to automatically dereference pointers when evaluating a JSON path, so that if a field is nil, nil is returned, otherwise the dereferenced value.In general, pointers are discouraged in Rudi and can lead to many hard to troubleshoot side effects. Support for them is on a best effort basis.