{"id":21485634,"url":"https://github.com/m0a/easyjson","last_synced_at":"2025-03-17T10:08:47.126Z","repository":{"id":20972811,"uuid":"24261765","full_name":"m0a/easyjson","owner":"m0a","description":"easyjson","archived":false,"fork":false,"pushed_at":"2016-10-05T22:04:33.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-15T08:46:44.599Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/m0a.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}},"created_at":"2014-09-20T12:04:11.000Z","updated_at":"2016-10-05T23:30:54.000Z","dependencies_parsed_at":"2022-07-30T02:47:56.070Z","dependency_job_id":null,"html_url":"https://github.com/m0a/easyjson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0a%2Feasyjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0a%2Feasyjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0a%2Feasyjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0a%2Feasyjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m0a","download_url":"https://codeload.github.com/m0a/easyjson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014136,"owners_count":20383715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-23T13:16:52.230Z","updated_at":"2025-03-17T10:08:46.049Z","avatar_url":"https://github.com/m0a.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# m0a/easyjson\n========\n\ngo's easy json access library\n\n\n## Usage\n\nsimple example:\n\n```go\n\npackage main\n\nimport (\n\t\"github.com/m0a/easyjson\"\n\t\"net/http\"\n\t\"fmt\"\n)\n\n\nfunc main() {\n\n\turl := \"http://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA\u0026destination=Concord,MA\u0026sensor=false\"\n\n\tresp, err := http.Get(url)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tpanic(resp.StatusCode)\n\t}\n\n\tjson,err := easyjson.NewEasyJson(resp.Body)\n\tif err!=nil {\n\t\tpanic(\"json convert err\")\n\t}\n\n\t//easy access!\n\tjson.K(\"routes\",0,\"bounds\",\"southwest\").PrettyPrint()\n\n\t//support method chain\n\tjson.K(\"routes\").K(0).K(\"bounds\").K(\"southwest\").PrettyPrint()\n\n    // if use loop\n\tfor k,v:=range json.K(\"routes\").K(0).RangeObjects() {\n\t\tfmt.Printf(\"%v:%v\\n\",k,v)\n\t}\n\n\t//string value\n\tcopyrights,err:=json.K(\"routes\").K(0).K(\"copyrights\").AsString()\n\tif err!=nil {\n\t\tpanic(\"AsString err\")\n\t}\n\n\n\tfmt.Printf(\"copyrights=%s\",copyrights)\n\n\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0a%2Feasyjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm0a%2Feasyjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0a%2Feasyjson/lists"}