mac下-bash: syntax error near unexpected token `('

在使用go-xorm将mysql的表结构导出为go 结构体时候,出现如下错误

$ xorm reverse mysql root:123456@tcp(127.0.0.1:3306)/dbname?charset=utf8 templates/goxorm/
-bash: syntax error near unexpected token `('

如上的小括号加上转义字符之后,问题消失

$ xorm reverse mysql root:123456@tcp\(127.0.0.1:3306\)/dbname?charset=utf8 templates/goxorm/

参考:

https://github.com/go-xorm/cmd

https://github.com/go-sql-driver/mysql

猜你喜欢

转载自blog.csdn.net/qq_21514303/article/details/81740058