File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,17 @@ func main() {
3434 val , ok := o.Get (" a" )
3535
3636 // use Keys instead of for k, v := range o
37- key := o.Keys ()
37+ keys := o.Keys ()
3838 for _ , k := range keys {
3939 v , _ := o.Get (k)
4040 }
4141
4242 // use o.Delete instead of delete(o, key)
43- err := o.Delete (" a" )
43+ o.Delete (" a" )
4444
4545 // serialize to a json string using encoding/json
4646 bytes , err := json.Marshal (o)
47- prettyBytes , err := json.MarshalIndent (o)
47+ prettyBytes , err := json.MarshalIndent (o, " " , " " )
4848
4949 // deserialize a json string using encoding/json
5050 // all maps (including nested maps) will be parsed as orderedmaps
@@ -55,7 +55,7 @@ func main() {
5555 o.SortKeys (sort.Strings )
5656
5757 // sort by Pair
58- o.Sort (func (a *Pair, b *Pair) bool {
58+ o.Sort (func (a *orderedmap. Pair , b *orderedmap. Pair ) bool {
5959 return a.Value ().(float64 ) < b.Value ().(float64 )
6060 })
6161}
You can’t perform that action at this time.
0 commit comments