Registry /
serialization / virtuald-go-ordered-json
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
json
✓ github.com/virtuald/go-ordered-json
Unmarshal JSON into an ordered map preserving key order
package main
import (
"fmt"
"github.com/virtuald/go-ordered-json"
)
func main() {
data := []byte(`{"b":1,"a":2}`)
var m json.OrderedMap
if err := json.Unmarshal(data, &m); err != nil {
panic(err)
}
for _, k := range m.Keys() {
v, _ := m.Get(k)
fmt.Printf("%s: %v\n", k, v)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20170621173500-b18e6e673d74latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.