From 92a8a1f980acaf0d6725a93b1d2091e203819c23 Mon Sep 17 00:00:00 2001 From: Mateusz Kozak Date: Wed, 8 Aug 2018 22:06:04 +0200 Subject: [PATCH] Update README.md fix example on how to deserialize key-value JSON --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7ea8f98..1a545fa 100644 --- a/README.md +++ b/README.md @@ -1278,18 +1278,18 @@ package main import ( "fmt" - "github.com/emirpasic/gods/lists/arraylist" + "github.com/emirpasic/gods/maps/hashmap" ) func main() { - list := arraylist.New() + hm := hashmap.New() - json := []byte(`["a","b"]`) - err := list.FromJSON(json) + json := []byte(`{"a":"1","b":"2"}`) + err := hm.FromJSON(json) if err != nil { fmt.Println(err) } - fmt.Println(list) // ArrayList ["a","b"] + fmt.Println(hm) // HashMap map[b:2 a:1] } ```