Go's JSON package does not provide a way to distinguish between null keys and keys which do not exist on a structure. This package provides such functionality.
const json = []byte(`{"hello": {"world": true}}`)
ok := hasOwnProperty.Test(json, "hello") // true
ok = hasOwnProperty.Test(json, "hello.world") // true
ok = hasOwnProperty.Test(json, "goodbye") // false
Test checks that the provided property exists in the JSON string. It returns
a boolean whether it does, and an error if it fails to parse the JSON.
The "path" may be written in dot notation. For example: