Sergi Bas
Sergi Bas

Reputation: 1

Error when try to install BEEGO

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 }

Upvotes: 0

Views: 333

Answers (2)

Leo Correa
Leo Correa

Reputation: 19789

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.

Upvotes: 3

Ainar-G
Ainar-G

Reputation: 36189

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.

Upvotes: 1

Related Questions