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

之前自己学的 python ,但是公司要我学习 go,给了我一大段 python 的代码,要我翻译成 go,但是自己现在初学,大家有什么好的资料吗?
还有一个问题:
python 中:
umeng_devicetoken=MySQLdb.escape_string(web.utf8(data.get('umeng_devicetoken','')))
但是在 go 中该怎么写呢?
1 yougg Dec 29, 2015 |
2 sun2920989 Dec 29, 2015 the way to go 我觉得不错 |
4 elgoog1970 Dec 29, 2015 为什么要转 golang? |
5 janxin Dec 29, 2015 Golang 里面不需要专门 escape_string ,用参数绑定就好。 |
6 cloudzhou Dec 29, 2015 @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 变成字符? 建议你还是一步步学起来吧 |
7 Bown Dec 29, 2015 |
8 pathletboy Dec 29, 2015 https://golang.org/pkg/ 注意看里面的例子,学习即可。 |
9 latyas Dec 29, 2015 via Android 同问 |
10 bianweiall Dec 29, 2015 umeng_devicetoken=MySQLdb.escape_string(web.utf8(data.get('umeng_devicetoken',''))) 这里面有: https://github.com/ziutek/mymysql/blob/master/mysql/utils.go |