GO中怎么处理URL编码?

adwin · · 5429 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

比如我有一串字符串格式的URL,例如下边这样: %5B%7B%22ip%22%3A%22119.90.49.95%22%2C%22port%22%3A%228074%22%7D%2C%7B%22ip%22%3A%22119.90.49.110%22%2C%22port%22%3A%228050%22%7D%2C%7B%22ip%22%3A%22119.90.49.92%22%2C%22port%22%3A%228057%22%7D%2C%7B%22ip%22%3A%22119.90.49.104%22%2C%22port%22%3A%228016%22%7D%2C%7B%22ip%22%3A%22119.90.49.104%22%2C%22port%22%3A%228017%22%7D%2C%7B%22ip%22%3A%22119.90.49.102%22%2C%22port%22%3A%228007%22%7D%2C%7B%22ip%22%3A%22119.90.49.107%22%2C%22port%22%3A%228034%22%7D%2C%7B%22ip%22%3A%22119.90.49.110%22%2C%22port%22%3A%228049%22%7D%2C%7B%22ip%22%3A%22119.90.49.91%22%2C%22port%22%3A%228053%22%7D%2C%7B%22ip%22%3A%22119.90.49.94%22%2C%22port%22%3A%228069%22%7D%5D 我想通过类似urldecode这样的函数转化为下边这样的形式: ```[{"ip":"119.90.49.95","port":"8074"},{"ip":"119.90.49.110","port":"8050"},{"ip":"119.90.49.92","port":"8057"},{"ip":"119.90.49.104","port":"8016"},{"ip":"119.90.49.104","port":"8017"},{"ip":"119.90.49.102","port":"8007"},{"ip":"119.90.49.107","port":"8034"},{"ip":"119.90.49.110","port":"8049"},{"ip":"119.90.49.91","port":"8053"},{"ip":"119.90.49.94","port":"8069"}]``` 百度了好久也没找到GO中有类似的函数或者是库,难道这个问题不会经常用到么,,,还望大神解决

有疑问加站长微信联系(非本文作者)

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

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