{"id":26777833,"url":"https://github.com/michaelwp/gojson","last_synced_at":"2026-04-30T00:04:14.361Z","repository":{"id":284719625,"uuid":"955843501","full_name":"michaelwp/goJson","owner":"michaelwp","description":"GoJsonStruct is a lightweight library designed to easily convert Go structs to JSON and vice versa. It provides simple methods to serialize and deserialize JSON data.","archived":false,"fork":false,"pushed_at":"2025-03-28T04:06:29.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T05:19:23.512Z","etag":null,"topics":["go","json","struct"],"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/michaelwp.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-27T09:35:58.000Z","updated_at":"2025-03-28T04:05:50.000Z","dependencies_parsed_at":"2025-03-28T05:29:25.932Z","dependency_job_id":null,"html_url":"https://github.com/michaelwp/goJson","commit_stats":null,"previous_names":["michaelwp/gojsonstruct","michaelwp/gojson"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelwp%2FgoJson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelwp%2FgoJson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelwp%2FgoJson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelwp%2FgoJson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelwp","download_url":"https://codeload.github.com/michaelwp/goJson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140588,"owners_count":20729802,"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":["go","json","struct"],"created_at":"2025-03-29T05:10:43.770Z","updated_at":"2026-04-30T00:04:14.328Z","avatar_url":"https://github.com/michaelwp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoJson - Simple JSON Converter for Go\n\nGoJson is a lightweight library designed to easily convert Go structs to JSON and vice versa. It provides simple methods to serialize and deserialize JSON data.\n\n## 🚀 Features\n\n- **Convert struct to JSON** (`ToJSON`)\n- **Convert struct to pretty JSON** (`ToJSONPretty`)\n- **Convert JSON to struct** (`ToStruct`)\n\n## 📥 Installation\n\nTo install the package, run:\n\n```sh\ngo get github.com/michaelwp/goJson/v2\n```\n\n## 📌 Usage\n\n### Initialize the JSON Converter\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/michaelwp/goJson/v2\"\n)\n\nfunc main() {\n\tgoJSON := gojson.NewGoJSON()\n\n\ttype User struct {\n\t\tName  string `json:\"name\"`\n\t\tAge   int    `json:\"age\"`\n\t\tEmail string `json:\"email\"`\n\t}\n\n\tuser := User{Name: \"Alice\", Age: 30, Email: \"alice@example.com\"}\n\n\t// Convert struct to JSON\n\tjsonStr := goJSON.ToJSON(user)\n\tfmt.Println(jsonStr) // Output: {\"name\":\"Alice\",\"age\":30,\"email\":\"alice@example.com\"}\n\n\t// Convert struct to pretty JSON\n\tjsonPretty := goJSON.ToJSONPretty(user)\n\tfmt.Println(jsonPretty)\n\n\t// Convert json back to struct\n\tvar userStruct User\n\terr := goJSON.ToStruct(jsonStr, \u0026userStruct)\n\tif err != nil {\n\t\tfmt.Println(\"Error:\", err)\n\t} else {\n\t\tfmt.Println(userStruct) // Output: {Alice 30 alice@example.com}\n\t}\n}\n```\n\n## 🏆 Why GoJsonStruct?\n\n✅ Simple and easy-to-use API\n✅ Supports pretty JSON formatting\n✅ Minimal dependencies\n✅ Improves Go JSON handling efficiency\n\n## 📢 Contributing\n\nContributions are welcome! Feel free to submit pull requests or open issues.\n\n---\n\nEnjoy coding with **GoJson** – because working with JSON in Go should be effortless! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelwp%2Fgojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelwp%2Fgojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelwp%2Fgojson/lists"}