A go structure for handling dynamic JSON.
Steve Thielemann 814f756724 [Test] Added test.json and a test for it | 1 vuosi sitten | |
---|---|---|
LICENSE | 1 vuosi sitten | |
README.md | 1 vuosi sitten | |
go.mod | 1 vuosi sitten | |
node.go | 1 vuosi sitten | |
node_test.go | 1 vuosi sitten | |
test.json | 1 vuosi sitten | |
utilities.go | 1 vuosi sitten |
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: