英文:
Error when try to install BEEGO
问题
我对GO非常陌生,当我尝试在我的Windows 8桌面或在VirtualBox中的Debian8上安装beego框架时,出现了相同的错误:
sergi@odoo:~$ go get github.com/astaxie/beego
github.com/astaxie/beego
work/src/github.com/astaxie/beego/tree.go:144: 语法错误:意外的range,期望{
work/src/github.com/astaxie/beego/tree.go:155: 语法错误:意外的else,期望分号或换行符
work/src/github.com/astaxie/beego/tree.go:157: 非声明语句在函数体外
work/src/github.com/astaxie/beego/tree.go:158: 非声明语句在函数体外
work/src/github.com/astaxie/beego/tree.go:159: 非声明语句在函数体外
work/src/github.com/astaxie/beego/tree.go:160: 语法错误:意外的}
work/src/github.com/astaxie/beego/tree.go:257: 语法错误:意外的range,期望{
work/src/github.com/astaxie/beego/tree.go:267: 语法错误:意外的else,期望分号或换行符或}
work/src/github.com/astaxie/beego/tree.go:283: 语法错误:意外的}
英文:
I am very new with GO, and when I tried to install the framwork beego on my Windows 8 Desktop or in a VirtualBox with Debian8 I had the same error:
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 }
答案1
得分: 3
你似乎正在使用一个旧的Go版本,无法构建beego
包。
请注意,该包仅针对go 1.5.1
进行了测试。因此,请尝试升级到go 1.5.x
并再次尝试获取它。
我相信升级将解决你的问题。
https://github.com/astaxie/beego/blob/master/.travis.yml#L4
英文:
You seem to be using an old Go version which is failing to build the beego
package.
Note that the package is only tested against go 1.5.1
. So try upgrading to go 1.5.x
and attempt to fetch it again.
https://github.com/astaxie/beego/blob/master/.travis.yml#L4
I'm pretty sure the upgrade will fix your issues.
答案2
得分: 1
空的for range
循环是在Go 1.4中引入的。你的Go版本似乎比较旧。使用以下命令检查你的版本:
go version
如果版本低于1.4,请从官方网站安装新版本。
英文:
The empty for range
loops were introduced in Go 1.4. Your Go version seems to be older. Check your version with
go version
and if it's older than 1.4, install a newer version from the official website.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论