Created
November 24, 2015 07:23
-
-
Save sugilog/391f0a7e7cd4b6c5e1dc to your computer and use it in GitHub Desktop.
Treat 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
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
func main() { | |
var parsed map[ string ]interface{} | |
jsonString := []byte( `{"a":"hoge","b":1.234}` ) | |
json.Unmarshal( jsonString, &parsed ) | |
fmt.Println( parsed ) | |
fmt.Println( parsed[ "a" ] ) | |
fmt.Println( parsed[ "b" ] ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment