{"id":17650226,"url":"https://github.com/johnpili/parse-json-data-without-struct","last_synced_at":"2026-04-29T18:33:03.631Z","repository":{"id":144343902,"uuid":"574108516","full_name":"johnpili/parse-json-data-without-struct","owner":"johnpili","description":"Parsing JSON data without concrete struct in Go","archived":false,"fork":false,"pushed_at":"2023-10-15T20:45:26.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T08:18:03.380Z","etag":null,"topics":["go","golang","json","parsing","unmarshalling"],"latest_commit_sha":null,"homepage":"https://johnpili.com/how-to-parse-json-data-without-struct-in-golang/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnpili.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-12-04T13:06:33.000Z","updated_at":"2023-11-22T14:34:54.000Z","dependencies_parsed_at":"2023-10-16T12:29:05.289Z","dependency_job_id":"fb8d9c78-5dcf-411c-b29e-f502ad0cdb8a","html_url":"https://github.com/johnpili/parse-json-data-without-struct","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnpili/parse-json-data-without-struct","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpili%2Fparse-json-data-without-struct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpili%2Fparse-json-data-without-struct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpili%2Fparse-json-data-without-struct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpili%2Fparse-json-data-without-struct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnpili","download_url":"https://codeload.github.com/johnpili/parse-json-data-without-struct/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnpili%2Fparse-json-data-without-struct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","json","parsing","unmarshalling"],"created_at":"2024-10-23T11:37:14.463Z","updated_at":"2026-04-29T18:33:03.615Z","avatar_url":"https://github.com/johnpili.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-json-data-without-struct\nParsing JSON data without concrete struct in Go\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n)\n\nvar sampleJson = `{\n\t\"username\": \"herr.wayne\",\n\t\"password\": \"L3akyPa5sw0rd!\",\n\t\"name\": \"Herr Wayne\",\n\t\"website\": \"https://example.de\",\n\t\"number\": 123\n}`\n\nfunc main() {\n\trawData := []byte(sampleJson)\n\tvar payload interface{}                  //The interface where we will save the converted JSON data.\n\terr := json.Unmarshal(rawData, \u0026payload) // Convert JSON data into interface{} type\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tm := payload.(map[string]interface{}) // To use the converted data we will need to convert it into a map[string]interface{}\n\n\tlog.Printf(\"Username: %s\", m[\"username\"].(string))\n\tlog.Printf(\"Password: %s\", m[\"password\"].(string))\n\tlog.Printf(\"Name: %s\", m[\"name\"].(string))\n\tlog.Printf(\"Website: %s\", m[\"website\"].(string))\n\tlog.Printf(\"Number: %d\", int(m[\"number\"].(float64)))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnpili%2Fparse-json-data-without-struct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnpili%2Fparse-json-data-without-struct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnpili%2Fparse-json-data-without-struct/lists"}