Skip to content

Commit

Permalink
update to go1.18 (#1142)
Browse files Browse the repository at this point in the history
close #1138
  • Loading branch information
glorv authored Mar 17, 2022
1 parent 2b86683 commit 6d826a7
Show file tree
Hide file tree
Showing 12 changed files with 1,453 additions and 171 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ tools/bin/revive: tools/check/go.mod

tools/bin/golangci-lint: tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
GOBIN=$(CURDIR)/tools/bin $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint
2 changes: 1 addition & 1 deletion drainer/pump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type mockPumpPullBinlogsClient struct {
func (x *mockPumpPullBinlogsClient) Recv() (*binlog.PullBinlogResp, error) {
payload, ok := <-x.binlogBytesChan
if !ok {
return nil, errors.Errorf("pump test has ran out of binlog items!")
return nil, errors.Errorf("pump test has ran out of binlog items")
}
return &binlog.PullBinlogResp{Entity: binlog.Entity{Payload: payload}}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion drainer/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func genRouterAndBinlogEvent(cfg *SyncerConfig) (*router.Table, *bf.BinlogEvent,
for _, name := range *rule.BinlogFilterRule {
filterRule, ok := eventFilterTemplateMap[name] // NOTE: this return a copied value
if !ok {
return nil, nil, errors.Errorf("event filter rule name %s not found.", name)
return nil, nil, errors.Errorf("event filter rule name %s not found", name)
}
filterRule.SchemaPattern = rule.Source.Schema
filterRule.TablePattern = rule.Source.Table
Expand Down
122 changes: 110 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
module github.com/pingcap/tidb-binlog

go 1.16
go 1.18

require (
github.com/BurntSushi/toml v0.3.1
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/Shopify/sarama v1.30.0
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/dustin/go-humanize v1.0.0
github.com/go-sql-driver/mysql v1.6.0
github.com/godror/godror v0.29.0
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.2
github.com/google/btree v1.0.1 // indirect
github.com/google/gofuzz v1.0.0
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712
github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 // indirect
github.com/pingcap/kvproto v0.0.0-20211122024046-03abd340988f
github.com/pingcap/log v0.0.0-20210906054005-afc726e70354
github.com/pingcap/tidb v1.1.0-beta.0.20211231061751-74ef32ace2a2
Expand All @@ -33,12 +25,9 @@ require (
github.com/pingcap/tipb v0.0.0-20211227115224-a06a85f9d2a5
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414
github.com/soheilhy/cmux v0.1.5
github.com/spf13/cobra v1.2.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965
github.com/tikv/client-go/v2 v2.0.0-rc.0.20211229051614-62d6b4a2e8f7
github.com/tikv/pd v1.1.0-beta.0.20211118054146-02848d2660ee
Expand All @@ -49,7 +38,116 @@ require (
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
google.golang.org/grpc v1.41.0
)

require (
cloud.google.com/go v0.93.3 // indirect
cloud.google.com/go/storage v1.16.1 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/aws/aws-sdk-go v1.35.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cheggaaa/pb/v3 v3.0.8 // indirect
github.com/coocood/freecache v1.1.1 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8 // indirect
github.com/danjacques/gofslock v0.0.0-20191023191349-0a45f885bc37 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto v0.0.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/eapache/go-resiliency v1.2.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fatih/color v1.10.0 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/godror/knownpb v0.1.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/ratelimit v1.0.1 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-runewidth v0.0.12 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.5.0 // indirect
github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 // indirect
github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef // indirect
github.com/opentracing/basictracer-go v1.0.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/phf/go-queue v0.0.0-20170504031614-9abe38d0371d // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pingcap/errcode v0.3.0 // indirect
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 // indirect
github.com/pingcap/sysutil v0.0.0-20211208032423-041a72e5860d // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/shirou/gopsutil v3.21.3+incompatible // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/cobra v1.2.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/tklauser/go-sysconf v0.3.4 // indirect
github.com/tklauser/numcpus v0.2.1 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 // indirect
github.com/twmb/murmur3 v1.1.3 // indirect
github.com/uber/jaeger-client-go v2.22.1+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/urfave/negroni v1.0.0 // indirect
github.com/wangjohn/quickselect v0.0.0-20161129230411-ed8402a42d5f // indirect
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.5 // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.1.8 // indirect
google.golang.org/api v0.54.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 // indirect
)

replace google.golang.org/grpc => google.golang.org/grpc v1.29.1
3 changes: 1 addition & 2 deletions pkg/loader/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package loader

import (
"database/sql"
"fmt"
"sync"
"testing"

Expand Down Expand Up @@ -182,7 +181,7 @@ func createTable(db *sql.DB, loader Loader) error {
}

func dropTable(db *sql.DB, loader Loader) error {
sql := fmt.Sprintf("drop table if exists test1")
sql := "drop table if exists test1"
loader.Input() <- NewDDLTxn("test", "test1", sql)
return nil
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/security/security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ func (s *testSecuritySuite) TestToTLSConfig(c *C) {

config, err := dummyConfig.ToTLSConfig()
c.Assert(err, IsNil)
c.Assert(config, NotNil)
c.Assert(config.RootCAs.Subjects(), HasLen, 1)

cert, err := config.GetCertificate(nil)
c.Assert(err, IsNil)
sslKey, ok := cert.PrivateKey.(*ecdsa.PrivateKey)
Expand Down
1 change: 1 addition & 0 deletions pump/storage/log_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !linux
// +build !linux

package storage
Expand Down
1 change: 1 addition & 0 deletions pump/storage/log_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux

package storage
Expand Down
2 changes: 1 addition & 1 deletion reparo/reparo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (s *testReparoSuite) TestProcess(c *C) {
arg := fmt.Sprintf("-config=%s", getTemplateConfigFilePath())
args = append(args, arg)
args = append(args, fmt.Sprintf("-data-dir=%s", dir))
args = append(args, fmt.Sprintf("-dest-type=memory"))
args = append(args, "-dest-type=memory")

err := config.Parse(args)
c.Assert(err, IsNil, Commentf("arg: %s", arg))
Expand Down
6 changes: 3 additions & 3 deletions tests/dailytest/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ func (t *table) String() string {
}

ret := fmt.Sprintf("[table]name: %s\n", t.name)
ret += fmt.Sprintf("[table]columns:\n")
ret += "[table]columns:\n"
ret += t.printColumns()

ret += fmt.Sprintf("[table]column list: %s\n", t.columnList)

ret += fmt.Sprintf("[table]indices:\n")
ret += "[table]indices:\n"
for k, v := range t.indices {
ret += fmt.Sprintf("key->%s, value->%v", k, v)
}

ret += fmt.Sprintf("[table]unique indices:\n")
ret += "[table]unique indices:\n"
for k, v := range t.uniqIndices {
ret += fmt.Sprintf("key->%s, value->%v", k, v)
}
Expand Down
Loading

0 comments on commit 6d826a7

Please sign in to comment.