https://github.com/gomodules/encoding
https://github.com/gomodules/encoding
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gomodules/encoding
- Owner: gomodules
- License: apache-2.0
- Created: 2021-08-10T15:12:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T23:14:02.000Z (over 1 year ago)
- Last Synced: 2025-04-08T05:17:03.402Z (about 1 year ago)
- Language: Go
- Size: 2.07 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/gomodules/encoding/actions/workflows/ci.yml)
[](https://pkg.go.dev/gomodules.xyz/encoding)
# encoding
This library has been forked from https://github.com/kubernetes/apimachinery/tree/v0.29.3/pkg/util so that it can easily used in non-k8s related projects.
## Why?
Go `encoding/json` package will automatically convert any number into `float64`, when any json string is unmarshled into a `map[string]interface{}`. This is a common use-case for Kubernetes libraries. To fix this issue, Kubernetes uses their own version of json library (a wrapper) that correctly converts to `int64/float64`. This library is forked from Kubernetes so that it can be used in various places without the whole Kubernetes dependency.