1. 程式人生 > >mac下-bash: syntax error near unexpected token `('

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

在使用go-xorm將mysql的表結構匯出為go 結構體時候,出現如下錯誤

$ xorm reverse mysql root:[email protected](127.0.0.1:3306)/dbname?charset=utf8 templates/goxorm/
-bash: syntax error near unexpected token `('

如上的小括號加上轉義字元之後,問題消失

$ xorm reverse mysql root:[email protected]\(127.0.0.1:3306\)/dbname?charset=utf8 templates/goxorm/

 

參考:

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

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