Преглед изворни кода

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

Marco Cadetg пре 7 година
родитељ
комит
9931b2c9cf
2 измењених фајлова са 3 додато и 2 уклоњено
  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>
 Luke Hines <lukehines@protonmail.com>
 Jacob Greenleaf <jacob@jacobgreenleaf.com>
 Jacob Greenleaf <jacob@jacobgreenleaf.com>
 Alex Lourie <alex@instaclustr.com>; <djay.il@gmail.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
 // 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 {
 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
 // NewBatch creates a new batch operation using defaults defined in the cluster