Skip to content

Instantly share code, notes, and snippets.

@weinung-chiu
Last active May 5, 2020 15:25
Show Gist options
  • Save weinung-chiu/a9e309fe9e2b6c74523376afb9942fec to your computer and use it in GitHub Desktop.
Save weinung-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