Use the gocql driver to create a session by initializing a cluster with your Cassandra contact points and calling Connect().
import "github.com/gocql/gocql"
cluster := gocql.NewCluster("127.0.0.1")
session, err := cluster.CreateSession()
if err != nil {
log.Fatal(err)
}
defer session.Close()
This establishes a connection to the Cassandra cluster at the specified address, allowing you to execute queries via the session object.