-
-
Save mottaquikarim/cbf03f8daadbcda9de5d9b3dc399948a to your computer and use it in GitHub Desktop.
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 ( | |
"encoding/json" | |
"strings" | |
) | |
func main() { | |
jsonData := `{ | |
"email":"abhirockzz@gmail.com", | |
"username":"abhirockzz", | |
"blogs":[ | |
{"name":"devto","url":"https://dev.to/abhirockzz/"}, | |
{"name":"medium","url":"https://medium.com/@abhishek1987/"} | |
]}` | |
jsonDataReader := strings.NewReader(jsonData) | |
decoder := json.NewDecoder(jsonDataReader) | |
var profile map[string]interface{} | |
err := decoder.Decode(&profile) | |
if err != nil { | |
panic(err) | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment