Skip to content

Dynamically setting data in JSON? #120

Answered by ohler55
kabukky asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like the most direct way is probably best here. Step one is collect the values. Then prepare the value to be set. Finally set the value in the data. In the example it seems that the setter traverses all of the data to calculate a value for setting so it doesn't really make sense to localize it to an individual field that reaches across the data.

A similar situation might be converting a slice of strings into a string. That is supported using the recently added Modify() in the jp package.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kabukky
Comment options

@ohler55
Comment options

Answer selected by kabukky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants