Skip to content

Instantly share code, notes, and snippets.

@charlie-chiu
Last active May 5, 2020 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlie-chiu/a9e309fe9e2b6c74523376afb9942fec to your computer and use it in GitHub Desktop.
Save charlie-chiu/a9e309fe9e2b6c74523376afb9942fec to your computer and use it in GitHub Desktop.
CharlieCC_JSON
a := map[string]interface{} {"name": "Charlie", "age": 20}
b := map[string]interface{} {"name": "Charlie", "age": 20}
fmt.Printf("a: %v\nb: %v\nDeepEqual:%v\n", a, b, reflect.DeepEqual(a, b))
err := json.Unmarshal([]byte(`{"name": "Charlie", "age": 20}`), &b)
if err != nil {
panic("oops")
}
fmt.Printf("a: %v\nb: %v\nDeepEqual:%v\n", a, b, reflect.DeepEqual(a, b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment