Hacker GitHub

← All repos

ChimeraCoder/gojson

View on GitHub ↗ ★ 2,682 Go

Automatically generate Go (golang) struct definitions from example JSON

16 mentions on Hacker News by 6 people: 0 stories, 16 comments · first 2013-01-01 · latest 2023-05-07

Mentions per year 16 mentions · busiest year 2014 (5)
20082026
  1. Check out https://github.com/ChimeraCoder/gojson as well, been my go to for this.
  2. …would make your life a lot easier - it automatically generates the struct definitions for you. [0] https://github.com/ChimeraCoder/gojson
    comment by chimeracoder · 2017-12-06 · in Why I love Go
  3. …your struct definitions, in a schema-like fashion. I wrote a tool to automate that process: https://github.com/ChimeraCoder/gojson I use this as a step in the build system for the projects, which ensures that the definitions stay in sync…
    comment by chimeracoder · 2017-09-22 · in Go: Ten years and climbing
  4. Yes, it's pain! Unless you have the struct ready for unmarshalling json. I use gojson [ https://github.com/ChimeraCoder/gojson ], it auto generates struct from json with a simple command. curl -s https://api.github.com/repos/chimeracoder/go…
  5. …you may be looking for something like https://mholt.github.io/json-to-go/ (by the same author) or https://github.com/ChimeraCoder/gojson (which I've used myself). (I find that what I pay in using a static language like Go to manipulate…
    comment by jerf · 2016-02-10 · in Convert curl commands to Go code
  6. …you're sick of writing out the struct definitions yourself, you can generate them from sample JSON: https://github.com/ChimeraCoder/gojson This is especially useful when implementing REST servers/clients, because you can simply include an…
    comment by chimeracoder · 2015-11-10 · in Six years of Go
  7. …benefit, the struct value, once unmarshalled, is typesafe (which is not true in Python[1]). [0] https://github.com/ChimeraCoder/gojson [1] Because Python is not only dynamically typed but strongly typed, I've more than once run into an…
    comment by chimeracoder · 2015-02-04 · in JSON, interfaces, and go generate
  8. …it all out by hand - if you have a single example JSON response, you can generate it automatically: https://github.com/ChimeraCoder/gojson
    comment by chimeracoder · 2014-12-30 · in Everyday hassles in Go
  9. …JSON. There is also a CLI tool[2] that does the same. [1] http://mholt.github.io/json-to-go/ [2] https://github.com/ChimeraCoder/gojson
    comment by anonfunction · 2014-12-03 · in Show HN: Jason – A new JSON Library for Go
  10. …in advance, I wrote a tool for automatically generating the appropriate struct definition for it: https://github.com/ChimeraCoder/gojson (I see these as complimentary tools, rather than conflicting or competing, since they would have two…
    comment by chimeracoder · 2014-12-02 · in Show HN: Jason – A new JSON Library for Go
  11. An offline version: https://github.com/ChimeraCoder/gojson
    comment by cridenour · 2014-05-31 · in Turn JSON into a useful Go Struct
  12. …manually, and a lot of type assertions compared to using map[string]interface{} everywhere. [0] https://github.com/ChimeraCoder/gojson
    comment by chimeracoder · 2014-03-31 · in Show HN: ffjson: faster json serialization in Go
  13. …created a tool in Go to automatically generate struct definitions, given an example JSON response: https://github.com/ChimeraCoder/gojson In the time that I've been using it (since last December), I don't think I've run into any issues…
    comment by chimeracoder · 2013-11-29 · in Announcing Scala.js v0.1
  14. …you're referring to here, but I wrote a tool to enable with mapping JSON to native Go types: https://github.com/ChimeraCoder/gojson . Basically, you specify the narrowest possible type that covers all expected (valid) inputs. If your JSON…
  15. …but if the latter (and your data is stored in JSON), you may find this package I wrote useful: https://www.github.com/ChimeraCoder/gojson Instead of unmarshalling to map[string]interface{} and then doing awkward type assertions and checks,…
  16. …since I didn't want to generate the structs by hand. Go's reflection made this really easy. https://github.com/chimeracoder/gojson
    comment by chimeracoder · 2013-01-01 · in Thoughts on Go after writing 3 websites