Skip to content
This repository was archived by the owner on Mar 16, 2025. It is now read-only.
This repository was archived by the owner on Mar 16, 2025. It is now read-only.

Support custom structs #14

@xrstf

Description

@xrstf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions