Top 0.8% dependent packages on proxy.golang.org
Top 1.3% dependent repos on proxy.golang.org
Top 4.2% forks on proxy.golang.org
proxy.golang.org : github.com/palantir/pkg/safejson
Package safejson provides functions that allows JSON to be marshaled and unmarshaled in a safe and consistent manner. This package exists to standardize and normalize some of the default behavior of the json package that is unintuitive. Marshal: The default encoder returned by json.NewEncoder has "SetEscapeHTML" set to "true", which makes sense for HTML environments, but results in output that is hard to read in non-HTML environments. The default behavior of json.Marshal also appends a newline to the end of the generated JSON which, although this is technically legal from a JSON perspective, is often unexpected. Unmarshal: The default decoder returned by json.NewDecoder does not have the "UseNumber" behavior enabled. This means that all numeric values are unmarshaled as a float64. This behavior is generally less flexible, so safejson sets "UseNumber" to "true", which ensures that all numbers are unmarshaled as a json.Number.
Registry
-
Source
- Documentation
- JSON
- codemeta.json
purl: pkg:golang/github.com/palantir/pkg/safejson
Keywords:
octo-correct-managed
License: BSD-3-Clause
Latest release: 2 months ago
First release: almost 6 years ago
Namespace: github.com/palantir/pkg
Dependent packages: 35
Dependent repositories: 18
Stars: 65 on GitHub
Forks: 34 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 23 days ago