https://github.com/coreos/go-json
Modified version of go's encoding/json library which allows decoding to a Node struct with offset information
https://github.com/coreos/go-json
Last synced: about 1 year ago
JSON representation
Modified version of go's encoding/json library which allows decoding to a Node struct with offset information
- Host: GitHub
- URL: https://github.com/coreos/go-json
- Owner: coreos
- License: bsd-3-clause
- Created: 2016-07-27T22:33:16.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2023-11-02T16:16:14.000Z (over 2 years ago)
- Last Synced: 2025-04-14T22:08:02.668Z (about 1 year ago)
- Language: Go
- Size: 436 KB
- Stars: 3
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-json
This is a fork of Go's `encoding/json` library. It adds a third target for
unmarshalling, `json.Node`.
Unmarshalling to a `Node` behaves similarly to unmarshalling to
`any`, except that it also records the offsets for the start and end
of the value that is unmarshalled and, if the value is part of a JSON
object, the offsets of the start and end of the object's key. The `Value`
field of the `Node` is unmarshalled to the same type as if it were
`any`, except in the case of arrays and objects:
| JSON type | Go type, unmarshalled to `any` | `Node.Value` type |
| --------- | ------------------------------ | ----------------- |
| Array | `[]any` | `[]Node` |
| Object | `map[string]any` | `map[string]Node` |
| Other | `any` | `any` |