I get this error trying to compile:
package main
import "fmt"
import "log"
import "github.com/gocql/gocql"
var (
name, sex string
age int
)
func main() {
// connect to the cluster
cluster := gocql.NewCluster("127.0.0.1")
cluster.Keyspace = "dbaccess"
session, _ := cluster.CreateSession()
defer session.Close()
cluster.ProtoVersion = 4
if err := session.Query("SELECT name, age FROM people WHERE name='doug'").Scan(&name, &age);
err != nil {
log.Fatal(err)
}
fmt.Println(name, age)
}
I added the line
cluster.ProtoVersion = 4
After reading about it here but I'm too new to understand if that's my issue, or I did something wrong elsewhere. Do I have to wait for an update to gocql that fixes this, or what should I do?