Conversation
And add a couple of helper methods: one to remove trace metadata from values and one to remove all metadata from an Environment. This allows embedders to more easily provide less heavyweight representations of evaluated values.
|
Part of the motivation here is the potential to add support in the ESC API for returning an opened environment in a form that does not include this metadata. The metadata-free form is likely to be easier to consume for most API-level users. |
borisschlosser
left a comment
There was a problem hiding this comment.
lgtm! Let me know your thoughts where we can leverage these changes in ESC.
|
I think rather than stripping metadata, it might be nice to have a helper that converts an esc.Value tree into a go value. I think users asking for a simpler representation probably just want a direct mapping to the shape the environment defines. Then we don't lossily drop metadata, we just provide a convenience mapping for direct lookups when desired. Edit: actually we already have this with the ToJSON() helper! |
Yes--we already have It could be that we should just add a parameter to the REST API that allows all metadata to be discarded (i.e. call |
And add a couple of helper methods: one to remove trace metadata from values and one to remove all metadata from an Environment. This allows embedders to more easily provide less heavyweight representations of evaluated values.