Skip to content

Commit

Permalink
fix deepsource go
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango committed Sep 7, 2020
1 parent 74920f0 commit d79b6b4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 21 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ replace (
github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.0+incompatible
github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.34.18
github.com/boltdb/bolt => github.com/boltdb/bolt v1.3.1

github.com/coreos/etcd => go.etcd.io/etcd v3.3.25+incompatible
github.com/docker/docker => github.com/moby/moby v1.13.1
github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v0.4.1
Expand All @@ -22,9 +21,7 @@ replace (
github.com/gorilla/websocket => github.com/gorilla/websocket v1.4.2
github.com/hailocab/go-hostpool => github.com/monzo/go-hostpool v0.0.0-20200724120130-287edbb29340
github.com/hydrogen18/memlistener => github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91

github.com/klauspost/compress => github.com/klauspost/compress v1.10.11

github.com/klauspost/compress => github.com/klauspost/compress v1.10.12-0.20200903102441-28b892527237
github.com/tensorflow/tensorflow => github.com/tensorflow/tensorflow v2.1.0+incompatible
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
google.golang.org/grpc => google.golang.org/grpc v1.31.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5Pt
github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.10.11 h1:K9z59aO18Aywg2b/WSgBaUX99mHy2BES18Cr5lBKZHk=
github.com/klauspost/compress v1.10.11/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.10.12-0.20200903102441-28b892527237 h1:/d9euTqPnSaB1CVc/lFFns/hHf1JTZAxfEWS5dbn+x0=
github.com/klauspost/compress v1.10.12-0.20200903102441-28b892527237/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kpango/fastime v1.0.8/go.mod h1:Y5XY5bLG5yc7g2XmMUzc22XYV1XaH+KgUOHkDvLp4SA=
Expand Down
4 changes: 1 addition & 3 deletions internal/errors/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ var (
}
}

ErrCassandraUnavailable = func() error {
return NewErrCassandraUnavailableIdentity()
}
ErrCassandraUnavailable = NewErrCassandraUnavailableIdentity

ErrCassandraNotFound = func(keys ...string) error {
switch {
Expand Down
4 changes: 1 addition & 3 deletions internal/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ var (
return nil
}

Unwrap = func(err error) error {
return errors.Unwrap(err)
}
Unwrap = errors.Unwrap

Errorf = func(format string, args ...interface{}) error {
if format != "" && args != nil && len(args) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/backup/cassandra/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (s *server) GetVector(ctx context.Context, req *payload.Backup_GetVector_Re
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("GetVector API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("GetVector API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[GetVector]\tunknown error\t%+v", err)
Expand Down
16 changes: 8 additions & 8 deletions pkg/meta/cassandra/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (s *server) GetMeta(ctx context.Context, key *payload.Meta_Key) (*payload.M
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("GetMeta API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("GetMeta API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[GetMeta]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -104,7 +104,7 @@ func (s *server) GetMetas(ctx context.Context, keys *payload.Meta_Keys) (mv *pay
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return mv, status.WrapWithUnavailable(fmt.Sprintf("GetMetas API Cassandra unavailable"), err, info.Get())
return mv, status.WrapWithUnavailable("GetMetas API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[GetMetas]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -139,7 +139,7 @@ func (s *server) GetMetaInverse(ctx context.Context, val *payload.Meta_Val) (*pa
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("GetMetaInverse API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("GetMetaInverse API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[GetMetaInverse]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -177,7 +177,7 @@ func (s *server) GetMetasInverse(ctx context.Context, vals *payload.Meta_Vals) (
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return mk, status.WrapWithUnavailable(fmt.Sprintf("GetMetasInverse API Cassandra unavailable"), err, info.Get())
return mk, status.WrapWithUnavailable("GetMetasInverse API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[GetMetasInverse]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -252,7 +252,7 @@ func (s *server) DeleteMeta(ctx context.Context, key *payload.Meta_Key) (*payloa
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("DeleteMeta API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("DeleteMeta API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[DeleteMeta]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -290,7 +290,7 @@ func (s *server) DeleteMetas(ctx context.Context, keys *payload.Meta_Keys) (mv *
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("DeleteMetas API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("DeleteMetas API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[DeleteMetas]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -325,7 +325,7 @@ func (s *server) DeleteMetaInverse(ctx context.Context, val *payload.Meta_Val) (
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("DeleteMetaInverse API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("DeleteMetaInverse API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[DeleteMetaInverse]\tunknown error\t%+v", err)
Expand Down Expand Up @@ -363,7 +363,7 @@ func (s *server) DeleteMetasInverse(ctx context.Context, vals *payload.Meta_Vals
if span != nil {
span.SetStatus(trace.StatusCodeUnavailable(err.Error()))
}
return nil, status.WrapWithUnavailable(fmt.Sprintf("DeleteMetasInverse API Cassandra unavailable"), err, info.Get())
return nil, status.WrapWithUnavailable("DeleteMetasInverse API Cassandra unavailable", err, info.Get())

default:
log.Errorf("[DeleteMetasInverse]\tunknown error\t%+v", err)
Expand Down

0 comments on commit d79b6b4

Please sign in to comment.