I am trying to install this Cassandra driver for golang: https://github.com/tux21b/gocql
When I execute go get https://github.com/tux21b/gocql
I get
root@backend:/vagrant# go get tux21b.org/v1/gocql
# tux21b.org/v1/gocql
/usr/lib/go/src/pkg/tux21b.org/v1/gocql/conn.go:280: function ends without a return statement
/usr/lib/go/src/pkg/tux21b.org/v1/gocql/conn.go:359: function ends without a return statement
/usr/lib/go/src/pkg/tux21b.org/v1/gocql/conn.go:407: function ends without a return statement
/usr/lib/go/src/pkg/tux21b.org/v1/gocql/marshal.go:1000: function ends without a return statement
How can I manage the package to be installed?
The first thing to do when encountered with this particular compile error is to make sure you have upgraded from version 1.0 of Go to version 1.1 or newer.
The reason is that Go compiler have become smarter in detecting functions that don’t return their expected return values. For example, a function like this:
function check(n int) bool {
if n > 10 {
return true
} else {
return false
}
}
would lead to a compile error with Go 1.0, but Go 1.1 can correctly detect that this function always return a value and is OK.