sorry if it is beginner level but this bothers me overnight. I’ve got a task about writing about lib for manipulating json file with defined configuration file.
e.g:
[
{
"age": 65,
"income": 6000,
}
]
example configuration file (define path and many operation with the fields)
"income","arithmetic","multiply","0.8"
and the result is a new output json file with changed fields (may be with more complicated objects, map, array, etc):
[
{
"age": 65,
"income": 4800,
}
]
Since the json file is arbitrary, I found there’s no way to decode and encode with pre-defined structs by encoding/json
lib.
Any ideas on how to solve this correctly? appreciate it.