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