Explorar el Código

fix usage of deprecated gocql.NewBatch function. (#1196)

Marco Cadetg hace 7 años
padre
commit
9931b2c9cf
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 1 0
      AUTHORS
  2. 2 2
      session.go

+ 1 - 0
AUTHORS

@@ -107,3 +107,4 @@ Ingo Oeser <nightlyone@gmail.com>
 Luke Hines <lukehines@protonmail.com>
 Jacob Greenleaf <jacob@jacobgreenleaf.com>
 Alex Lourie <alex@instaclustr.com>; <djay.il@gmail.com>
+Marco Cadetg <cadetg@gmail.com>

+ 2 - 2
session.go

@@ -1443,9 +1443,9 @@ type Batch struct {
 
 // NewBatch creates a new batch operation without defaults from the cluster
 //
-// Depreicated: use session.NewBatch instead
+// Deprecated: use session.NewBatch instead
 func NewBatch(typ BatchType) *Batch {
-	return &Batch{Type: typ}
+	return &Batch{Type: typ, metrics: make(map[string]*queryMetrics)}
 }
 
 // NewBatch creates a new batch operation using defaults defined in the cluster