Last active
May 5, 2020 15:25
-
-
Save weinung-chiu/a9e309fe9e2b6c74523376afb9942fec to your computer and use it in GitHub Desktop.
CharlieCC_JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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