我是GO的新手,当我尝试在我的Windows 8桌面或使用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 }
答案 0 :(得分:3)
您似乎正在使用未能构建beego
包的旧Go版本。
请注意,该软件包仅针对go 1.5.1
进行测试。所以尝试升级到1.5.x
并尝试再次获取它。
https://github.com/astaxie/beego/blob/master/.travis.yml#L4
我很确定升级会解决您的问题。
答案 1 :(得分:1)