Skip to content

Commit

Permalink
go.mod: fix bug in updating client-go
Browse files Browse the repository at this point in the history
Signed-off-by: shirly <AndreMouche@126.com>
  • Loading branch information
AndreMouche committed Jul 15, 2021
1 parent b7a050c commit 9269a51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/benchraw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package main

import (
"context"
"flag"
"fmt"
"net/http"
Expand All @@ -26,7 +27,8 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/parser/terror"
"github.com/tikv/client-go/v2/config"
"github.com/tikv/client-go/v2/tikv"
"github.com/tikv/client-go/v2/rawkv"

"go.uber.org/zap"
)

Expand All @@ -42,7 +44,8 @@ var (

// batchRawPut blinds put bench.
func batchRawPut(value []byte) {
cli, err := tikv.NewRawKVClient(strings.Split(*pdAddr, ","), config.Security{
ctx := context.Background()
cli, err := rawkv.NewClient(ctx, strings.Split(*pdAddr, ","), config.Security{
ClusterSSLCA: *sslCA,
ClusterSSLCert: *sslCert,
ClusterSSLKey: *sslKey,
Expand All @@ -61,7 +64,7 @@ func batchRawPut(value []byte) {
for j := 0; j < base; j++ {
k := base*i + j
key := fmt.Sprintf("key_%d", k)
err = cli.Put([]byte(key), value)
err = cli.Put(ctx, []byte(key), value)
if err != nil {
log.Fatal("put failed", zap.Error(err))
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ require (
golang.org/x/tools v0.1.4
google.golang.org/grpc v1.27.1
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
honnef.co/go/tools v0.2.0 // indirect
modernc.org/mathutil v1.2.2 // indirect
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0
sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67
Expand Down

0 comments on commit 9269a51

Please sign in to comment.