我是GO的新手,当我试图在我的Windows8桌面或Debian8的VirtualBox上安装framwork beego时,我遇到了同样的错误:
sergi@odoo:~$ go get github.com/astaxie/beego
# github.com/astaxie/beego
work/src/github.com/astaxie/beego/tree.go:144: syntax error: unexpected range, expecting {
work/src/github.com/astaxie/beego/tree.go:155: syntax error: unexpected else, expecting semicolon or newline
work/src/github.com/astaxie/beego/tree.go:157: non-declaration statement outside function body
work/src/github.com/astaxie/beego/tree.go:158: non-declaration statement outside function body
work/src/github.com/astaxie/beego/tree.go:159: non-declaration statement outside function body
work/src/github.com/astaxie/beego/tree.go:160: syntax error: unexpected }
work/src/github.com/astaxie/beego/tree.go:257: syntax error: unexpected range, expecting {
work/src/github.com/astaxie/beego/tree.go:267: syntax error: unexpected else, expecting semicolon or newline or }
work/src/github.com/astaxie/beego/tree.go:283: syntax error: unexpected }发布于 2016-01-25 22:17:35
您似乎正在使用旧的Go版本,该版本无法构建beego包。
请注意,该包仅针对go 1.5.1进行测试。因此,尝试升级到go 1.5.x,然后再次尝试获取它。
https://github.com/astaxie/beego/blob/master/.travis.yml#L4
我很确定升级会解决你的问题。
发布于 2016-01-25 21:47:16
https://stackoverflow.com/questions/34993894
复制相似问题