Skip to content

Instantly share code, notes, and snippets.

@sugilog sugilog/json.go
Created Nov 24, 2015

Embed
What would you like to do?
Treat JSON
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
You can’t perform that action at this time.