Skip to content

Instantly share code, notes, and snippets.

@sugilog
Created November 24, 2015 07:23
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 sugilog/391f0a7e7cd4b6c5e1dc to your computer and use it in GitHub Desktop.
Save sugilog/391f0a7e7cd4b6c5e1dc to your computer and use it in GitHub Desktop.
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