Skip to content

Instantly share code, notes, and snippets.

@akaDPR
Created December 31, 2019 06:23
Show Gist options
  • Save akaDPR/7103a4b9f3828944e0d75a9472821c10 to your computer and use it in GitHub Desktop.
Save akaDPR/7103a4b9f3828944e0d75a9472821c10 to your computer and use it in GitHub Desktop.
Unmarshal JSON without defining struct In golang
package main
import (
"fmt"
"encoding/json"
)
func main() {
samjson := `{"name":"mytheen"}`
var result map[string]interface{}
json.Unmarshal([]byte(samjson) , &result)
fmt.Println(result["name"])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment