[{"data":1,"prerenderedAt":300},["ShallowReactive",2],{"project-8687740":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":38,"post_text":41,"what":42,"said":87,"maker_in_thread":154,"shape":161,"grid":165,"attempts":264,"same_week":265,"maker_shows":40,"maker_hidden":293,"reader_version":294,"card":295},"8687740","Jason","A new JSON Library for Go","title","Show HN: Jason – A new JSON Library for Go","https:\u002F\u002Fgithub.com\u002Fantonholmquist\u002Fjason","github.com","antonholmquist",1417536300,2014,106,49,264,2272,12,"notable","languages","json library","library",[24,25,26,27],"go json","golang","json parsing","dynamic json","debated",-0.05,{"positive":31,"neutral":32,"mixed":33,"critical":31},3,4,0,10,{"idea":36,"execution":37},{"positive":31,"critical":33},{"positive":33,"critical":33},[39,39,33,33,33,33,31,33,33,33,33,39,33,33,33,33,31,33,33,33,33,33,33,33,33,33,40,33,33,33,33,33,31,40,33,33,33,33,31,40],5,1,null,{"problem":43,"audience":55,"pricing":41,"motivation":66,"time_to_build":41,"stack":73,"openness":86,"stage":86,"team_size":86},{"value":44,"source":45,"evidence":46},"Accessing nested or variable-structure JSON in Go without defining structs","commenter",[47,51],{"id":48,"by":49,"text":50},"8688237","jamieomatthews","For anyone wondering why this is necessary, as some others in this thread have mentioned, the standard go way to deserialize json is to pass a pointer to a struct, and the system…",{"id":52,"by":53,"text":54},"8688504","anonfunction","You're still parsing the entire JSON document at once. I believe what OP meant was getting a nested property without all the overhead of writing structs or parsing the entire…",{"value":56,"source":45,"evidence":57},"Go programmers handling heterogeneous JSON",[58,62],{"id":59,"by":60,"text":61},"8688072","chimeracoder","This looks like a good approach to dealing with heterogeneous JSON! (ie, JSON that has an unknown and\u002For variable structure.) I've always found encoding\u002Fjson a little clunky for…",{"id":63,"by":64,"text":65},"8688256","endymi0n","This. If your main use case is JSON as a serialized representation of the ever same object (plus or minus a few optional fields), encoding\u002Fjson is by far the fastest and most…",{"value":67,"source":68,"evidence":69},"Name chosen from a colleague's email quip about handling XML and JSON","maker",[70],{"id":71,"by":11,"text":72},"8687998","Haha, okay. Yes, I just really like the name since it originates from an email sent from one of the project managers at our office: \"Don't worry. We can handle both XML and Jason\".",[74,82],{"value":75,"source":76,"evidence":77},"Go","inferred",[78],{"id":79,"by":80,"text":81},"8688709","BarkMore","The jason package implementation decodes the entire JSON object to an interface{} using the standard encoding\u002Fjson package.",{"value":83,"source":45,"evidence":84},"encoding\u002Fjson",[85],{"id":79,"by":80,"text":81},"unknown",{"praise":88,"objections":94,"requests":113,"questions":114,"alternatives":124},[89],{"value":90,"source":45,"evidence":91},"Useful for dynamic JSON structures where encoding\u002Fjson is clunky",[92,93],{"id":59,"by":60,"text":61},{"id":63,"by":64,"text":65},[95,106],{"value":96,"source":45,"evidence":97},"Name is confusingly similar to the word JSON and a common first name",[98,102],{"id":99,"by":100,"text":101},"8687974","danso","I would stray away from making the library name too similar in phonetic sound to the data it's meant to process. There was already enough confusion in an office I worked at with…",{"id":103,"by":104,"text":105},"8691845","deadbeef404","Come on, there's a huge middle ground between \"Unicorn milk\" and a name that isn't a homophone of the format it works with. Let alone the fact that I don't like my first name…",{"value":107,"source":45,"evidence":108},"Name conflicts with an existing Mac JSON editor",[109],{"id":110,"by":111,"text":112},"8688775","gorbachev","The name is a little \"unfortunate\", give that there's a JSON editor for Mac OS X with the exact same name.",[],[115],{"value":116,"source":45,"evidence":117},"Why not just use encoding\u002Fjson with interface{} or RawMessage",[118,121],{"id":119,"by":53,"text":120},"8688447","I would say the most idiomatic way is having defined structs and using encoding\u002Fjson. Even when you don't know the json schema in advance you can still parse it into an…",{"id":122,"by":60,"text":123},"8688315","> There is no easy way to sort of \"parse\" json piece by piece, which is what this library provides Well, you can use json.RawMessage to delay decoding until other values are…",[125,132,140,147],{"value":126,"source":45,"evidence":127},"encoding\u002Fjson with interface{}",[128,129],{"id":119,"by":53,"text":120},{"id":130,"by":80,"text":131},"8688436","Passing a pointer to a struct is just one way to use the standard Go package. You can also pass a pointer to an interface{}, []interface{} or map[string]interface{} depending on…",{"value":133,"source":45,"evidence":134},"gojson and json-to-go struct generators",[135,136],{"id":59,"by":60,"text":61},{"id":137,"by":138,"text":139},"8688308","mholt","(Another plug here) I did too! Except it runs in the browser: https:\u002F\u002Fmholt.github.io\u002Fjson-to-go And I agree with you about the complementary aspect. Sometimes you can't control…",{"value":141,"source":45,"evidence":142},"zhash",[143],{"id":144,"by":145,"text":146},"8688889","seletskiy","...or use very simple lib like this one [1] to access to deep-nested structs using one call. [1] https:\u002F\u002Fgithub.com\u002Fzazab\u002Fzhash",{"value":148,"source":45,"evidence":149},"simplejson-go",[150],{"id":151,"by":152,"text":153},"8688533","w4rh4wk5","this looks quite familiar: https:\u002F\u002Fgithub.com\u002Flikexian\u002Fsimplejson-go if anyone is interested i did some slight modifications to the project above which are keep in my personal…",{"comments":155,"answered":33,"key":156},2,[157,160],{"id":158,"text":159},"8698952","Seems very handy! Thank you",{"id":71,"text":72},{"commenters":162,"max_depth":39,"maker_replies":155,"first_comment_mins":163,"lifespan_hours":164},31,36,45,[166,168,169,171,173,174,175,179,181,184,186,189,192,194,195,198,199,201,202,205,209,212,216,218,220,223,226,228,230,233,236,239,242,246,247,250,254,256,259,260,261],[59,33,39,167,60,33],"project\u002Fpositive\u002Fidea",[63,33,39,167,64,33],[137,33,33,170,138,33],"commenter\u002Fneutral\u002Fnone",[172,33,33,170,53,33],"8691763",[158,33,33,170,11,40],[119,40,33,170,53,33],[176,40,31,177,178,33],"8688662","project\u002Fneutral\u002Fidea","mrweasel",[144,40,33,180,145,33],"other\u002Fneutral\u002Fnone",[182,40,33,180,183,33],"8689861","Igglyboo",[185,40,33,180,53,33],"8691761",[187,40,33,180,188,33],"8695765","eikenberry",[190,40,39,167,191,33],"8695351","heavenlyhash",[48,155,33,193,49,33],"commenter\u002Fneutral\u002Fidea",[122,155,33,170,60,33],[196,155,33,170,197,33],"8688418","landr0id",[52,155,33,170,53,33],[79,155,31,200,80,33],"project\u002Fneutral\u002Fexecution",[130,155,33,170,80,33],[203,155,33,170,204,33],"8688957","joncooper",[206,155,33,207,208,33],"8689024","other\u002Fcritical\u002Fnone","rudolf0",[210,155,33,170,211,33],"8689816","enneff",[213,155,33,214,215,33],"8690874","other\u002Fcritical\u002Fdesign","aikah",[217,155,33,170,211,33],"8691256",[219,155,33,214,208,33],"8696343",[221,155,33,222,211,33],"8696896","commenter\u002Fneutral\u002Fdesign",[224,155,33,170,225,33],"8689237","troyk",[99,31,40,227,100,33],"project\u002Fcritical\u002Fnone",[71,31,33,229,11,40],"maker\u002Fneutral\u002Fnone",[231,31,33,180,232,33],"8688405","userbinator",[234,31,33,170,235,33],"8688501","izolate",[237,31,33,170,238,33],"8689752","randallsquared",[240,31,33,180,241,33],"8691170","JasonFruit",[243,31,31,244,245,33],"8688417","project\u002Fneutral\u002Fnone","todd3834",[103,31,40,227,104,33],[248,31,33,180,249,33],"8689155","autechr3",[251,31,33,252,253,33],"8689223","commenter\u002Fcritical\u002Fnone","elwell",[255,31,33,180,183,33],"8689874",[257,31,33,180,258,33],"8690069","Cookingboy",[151,32,31,244,152,33],[110,39,40,227,111,33],[262,39,33,170,263,33],"8689109","stonogo",[],[266,271,276,281,285,289],{"id":267,"name":268,"points":269,"category":270},"8683405","PSequel",247,"dev_tools",{"id":272,"name":273,"points":274,"category":275},"8671277","Deal Roundup",141,"web_saas",{"id":277,"name":278,"points":279,"category":280},"8679466","MagicEye.js",111,"creative",{"id":282,"name":283,"points":14,"category":284},"8687168","HackerSurf","productivity",{"id":286,"name":287,"points":288,"category":284},"8675445","GitBook WebEditor",86,{"id":290,"name":291,"points":292,"category":270},"8694029","Angular-Gantt",77,false,"v2",{"id":296,"name":5,"line":6,"ai":293,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":297,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":298,"url":9,"mix":299,"praise":90,"objection":96,"sub":21},8687740,[24,25,26,27],"5500003000050000300000000010000031000031",[31,32,33,31],1794036525665]