A go structure for handling dynamic JSON.
Steve Thielemann 814f756724 [Test] Added test.json and a test for it | 1 year ago | |
---|---|---|
LICENSE | 1 year ago | |
README.md | 1 year ago | |
go.mod | 1 year ago | |
node.go | 1 year ago | |
node_test.go | 1 year ago | |
test.json | 1 year ago | |
utilities.go | 1 year ago |
A go structure for handling dynamic JSON.
map[string]any
(or map[string]interface{}
as any
is an alias for interface{}
)map[string]any
/map[string]interface{}
) will be walked thru determining it's dynamic type *[]any
/[]interface{}
) will be walked thru determining it's dynamic type *any
/interface{}
) will be assigned to either a named structure or a un-named structure (un-named are used when the previous depth or "parent" is determined to be Arraylike (Arrays/Slices), while named structures are used when the previous depth or "parent" is determined to be Maplike (Maps))* This process is recursive, it will iterate over it's elements determining their type and can possibly cause it to iterate over that.
This concept uses pointers to structures heavily for a few reasons: