有什么好的 go 的资料吗?现在是 python 转 go

2015 年 12 月 29 日
 tooweakchen

之前自己学的 python ,但是公司要我学习 go,给了我一大段 python 的代码,要我翻译成 go,但是自己现在初学,大家有什么好的资料吗?
还有一个问题:
python 中:
umeng_devicetoken=MySQLdb.escape_string(web.utf8(data.get('umeng_devicetoken','')))

但是在 go 中该怎么写呢?

6269 次点击
所在节点    Python
11 条回复
yougg
2015 年 12 月 29 日
ohmycodeape
2015 年 12 月 29 日
the way to go 我觉得不错
dofy
2015 年 12 月 29 日
elgoog1970
2015 年 12 月 29 日
为什么要转 golang?
janxin
2015 年 12 月 29 日
Golang 里面不需要专门 escape_string ,用参数绑定就好。
cloudzhou
2015 年 12 月 29 日
@sun2920989 the way to go 很不错。
umeng_devicetoken=MySQLdb.escape_string(web.utf8(data.get('umeng_devicetoken','')))

这段话看起来是使用了 sql escape_string ?
data.get('umeng_devicetoken','') 是 http 的 GET 获取参数?
然后使用 utf8 变成字符?

建议你还是一步步学起来吧
Bown
2015 年 12 月 29 日
pathletboy
2015 年 12 月 29 日
https://golang.org/pkg/
注意看里面的例子,学习即可。
latyas
2015 年 12 月 29 日
同问
bianweiall
2015 年 12 月 29 日
umeng_devicetoken=MySQLdb.escape_string(web.utf8(data.get('umeng_devicetoken','')))

这里面有:
https://github.com/ziutek/mymysql/blob/master/mysql/utils.go
mikicomo
2015 年 12 月 29 日
@yougg mark !

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/246924

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX