https://github.com/suzuki-shunsuke/go-convmap
Go library to convert map[interface{}]interface{} to map[string]interface{}
https://github.com/suzuki-shunsuke/go-convmap
oss
Last synced: about 2 months ago
JSON representation
Go library to convert map[interface{}]interface{} to map[string]interface{}
- Host: GitHub
- URL: https://github.com/suzuki-shunsuke/go-convmap
- Owner: suzuki-shunsuke
- License: mit
- Created: 2020-10-15T10:45:58.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T12:34:44.000Z (6 months ago)
- Last Synced: 2024-10-29T15:00:59.527Z (6 months ago)
- Topics: oss
- Language: Go
- Homepage: https://pkg.go.dev/github.com/suzuki-shunsuke/go-convmap/convmap
- Size: 313 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-convmap
[](https://github.com/suzuki-shunsuke/go-convmap/actions)
[](https://pkg.go.dev/github.com/suzuki-shunsuke/go-convmap/convmap)
[](https://codeclimate.com/github/suzuki-shunsuke/go-convmap/test_coverage)
[](https://goreportcard.com/report/github.com/suzuki-shunsuke/go-convmap)
[](https://github.com/suzuki-shunsuke/go-convmap)
[](https://raw.githubusercontent.com/suzuki-shunsuke/go-convmap/main/LICENSE)Go library to convert `map[interface{}]interface{}` to `map[string]interface{}`.
## Background
https://github.com/go-yaml/yaml/issues/139
When we unmarshal YAML to `interface{}`, the data type of the map will be not `map[string]interface{}` but `map[interface{}]interface{}` even if the type of all keys is string.
YAML accepts map key whose type isn't string, but JSON doesn't accept map key except for string.
And not only JSON but also some languages like [Tengo](https://github.com/d5/tengo) allow only string as map key.So this library provides the feature to convert `map[interface{}]interface{}` to `map[string]interface{}`.
## LICENSE
[MIT](LICENSE)