Skip to content

Instantly share code, notes, and snippets.

@chris001177
Created August 15, 2019 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris001177/593e1a1b665da4ae5eae8a8fed093da9 to your computer and use it in GitHub Desktop.
Save chris001177/593e1a1b665da4ae5eae8a8fed093da9 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/gocql/gocql"
)
var Session *gocql.Session
type Emp struct {
id string
firstName string
lastName string
age int
}
func init() {
var err error
cluster := gocql.NewCluster("127.0.0.1")
cluster.Keyspace = "test"
Session, err = cluster.CreateSession()
if err != nil {
panic(err)
}
fmt.Println("cassandra init done")
}
func main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment