How do I parse and select specific things out of a .json file?

xuanbao · · 499 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Specifically for a .json file of a subreddit. I just want it to accrue all the links of submissions (say for example for <a href="/r/nba" rel="nofollow">/r/nba</a>), but I&#39;m not sure how to parse through a .json file and get the submissions in order</p> <hr/>**评论:**<br/><br/>tiberiousr: <pre><p><a href="https://blog.golang.org/json-and-go" rel="nofollow">https://blog.golang.org/json-and-go</a></p></pre>deusmetallum: <pre><p>Google JSON and Go, and there is a really good blog post about it.</p></pre>sihnon: <pre><p>To add to what others have said, paste the json into <a href="https://mholt.github.io/json-to-go/" rel="nofollow">json-to-go</a> and it&#39;ll generate a struct you can use in your code for easy parsing. Also useful: <a href="https://gobyexample.com/json" rel="nofollow">Go by Example</a></p></pre>patrickdlogan: <pre><p><a href="https://github.com/jmespath/go-jmespath" rel="nofollow">https://github.com/jmespath/go-jmespath</a></p> <p>A query language for JSON with a Go implementation.</p></pre>mzupzup: <pre><p>Do you mean something like <a href="https://github.com/buger/jsonparser" rel="nofollow">https://github.com/buger/jsonparser</a> ?</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

499 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传