浏览代码

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>
 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