elliotchance / elliotchance/orderedmap

`json.Marshal` — doesn't work

Open
#12 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1k
Forks
77
PR merge metrics
No merged PRs in 30d

Description

Hi,

I try convert `OrderedMap` to `json`, but receive empty object :/

```go
package main

import (
"fmt"
"encoding/json"
"github.com/elliotchance/orderedmap"
)

func main() {
m := orderedmap.NewOrderedMap()

m.Set("foo", "bar")
m.Set("qux", 1.23)
m.Set(123, true)

b, err := json.Marshal(m)
if err != nil {
fmt.Println("error:", err)
}

fmt.Println("result:", string(b)) // "result: {}" ⚠️
}
```

https://play.golang.org/p/UFER3tR6uPA

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.