Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error on client.go #73

Open
mlgd opened this issue Feb 22, 2016 · 6 comments
Open

Syntax error on client.go #73

mlgd opened this issue Feb 22, 2016 · 6 comments

Comments

@mlgd
Copy link

mlgd commented Feb 22, 2016

I got errors on Travis CI :
../../couchbase/go-couchbase/client.go:180: syntax error: unexpected range, expecting {
../../couchbase/go-couchbase/client.go:184: non-declaration statement outside function body
../../couchbase/go-couchbase/client.go:185: syntax error: unexpected }

for range vsm.ServerList {
    gs := <-ch
    rv[gs.Server] = gs
}

@steveyen : what syntax "for range" you used here ?

@mlgd mlgd changed the title Travis error Syntaxe error on client.go Feb 22, 2016
@mlgd mlgd changed the title Syntaxe error on client.go Syntax error on client.go Feb 22, 2016
@tleyden
Copy link
Contributor

tleyden commented Feb 22, 2016

@mlgd which version of go are you using?

@mlgd
Copy link
Author

mlgd commented Feb 23, 2016

Error occured on Go 1.3.3
https://travis-ci.org/astaxie/beego/jobs/110949060

@tleyden
Copy link
Contributor

tleyden commented Feb 23, 2016

@mlgd can you retry this on go 1.5? I think if you have a requirement to use go 1.3, you'll have to use an older commit.

@mlgd
Copy link
Author

mlgd commented Feb 23, 2016

I can't do that. It's an automatic integration with Travis CI

@astaxie
Copy link

astaxie commented Feb 26, 2016

@tleyden it works well from Go 1.4. As the new syntax start to suppor from Go1.4. Could it be compatible with the old version?

https://github.com/couchbase/go-couchbase/blob/master/client.go#L180-L183

change to

for _ range vsm.ServerList {
    gs := <-ch
    rv[gs.Server] = gs
}

@astaxie
Copy link

astaxie commented Feb 26, 2016

This repo already add travis.yml. but it looks you guys never use it. 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants