Skip to content

Commit

Permalink
unifed use pkg errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Nov 2, 2022
1 parent 0899829 commit d8ac04c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/CMGS/statsd v0.0.0-20160223095033-48c421b3c1ab
github.com/alicebob/miniredis/v2 v2.14.3
github.com/cenkalti/backoff/v4 v4.1.1
github.com/cornelk/hashmap v1.0.9-0.20221031160728-c3a0e7bb43df
github.com/cornelk/hashmap v1.0.9-0.20221102000129-36b3b9c2b7ec
github.com/docker/distribution v2.8.0+incompatible
github.com/docker/docker v20.10.0+incompatible
github.com/docker/go-connections v0.4.0
Expand All @@ -21,7 +21,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/muroq/redislock v0.0.0-20210327061935-5425e33e6f9f
github.com/opencontainers/image-spec v1.0.2
github.com/panjf2000/ants/v2 v2.5.0
github.com/panjf2000/ants/v2 v2.6.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/projecteru2/libyavirt v0.0.0-20220621042712-95cdc6363b1c
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534 h1:rtAn27wIbmOGUs7RIbVgPEjb31ehTVniDwPGXyMxm5U=
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cornelk/hashmap v1.0.9-0.20221031160728-c3a0e7bb43df h1:nZzJODCK5L5pocFghtum9MZJWz9avjtYfowjO3Wt/uI=
github.com/cornelk/hashmap v1.0.9-0.20221031160728-c3a0e7bb43df/go.mod h1:RfZb7JO3RviW/rT6emczVuC/oxpdz4UsSB2LJSclR1k=
github.com/cornelk/hashmap v1.0.9-0.20221102000129-36b3b9c2b7ec h1:nupDanEpZP2oWqBp06PZ6fbGmZwjSbfkNybrv389ZpQ=
github.com/cornelk/hashmap v1.0.9-0.20221102000129-36b3b9c2b7ec/go.mod h1:RfZb7JO3RviW/rT6emczVuC/oxpdz4UsSB2LJSclR1k=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
Expand Down Expand Up @@ -450,8 +450,8 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.m
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/panjf2000/ants/v2 v2.5.0 h1:1rWGWSnxCsQBga+nQbA4/iY6VMeNoOIAM0ZWh9u3q2Q=
github.com/panjf2000/ants/v2 v2.5.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE=
github.com/panjf2000/ants/v2 v2.6.0 h1:xOSpw42m+BMiJ2I33we7h6fYzG4DAlpE1xyI7VS2gxU=
github.com/panjf2000/ants/v2 v2.6.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
Expand Down
2 changes: 1 addition & 1 deletion resources/cpumem/models/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package models

import (
"context"
"errors"
"fmt"

"github.com/pkg/errors"
"github.com/projecteru2/core/log"
"github.com/projecteru2/core/resources/cpumem/types"
coretypes "github.com/projecteru2/core/types"
Expand Down
2 changes: 1 addition & 1 deletion resources/cpumem/types/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package types

import "errors"
import "github.com/pkg/errors"

var (
ErrInvalidCapacity = errors.New("invalid resource capacity")
Expand Down
3 changes: 2 additions & 1 deletion store/etcdv3/meta/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package meta
import (
"context"
"crypto/tls"
"errors"
"fmt"
"strconv"
"sync"
"testing"
"time"

"github.com/pkg/errors"

"github.com/projecteru2/core/lock"
"github.com/projecteru2/core/lock/etcdlock"
"github.com/projecteru2/core/log"
Expand Down
7 changes: 3 additions & 4 deletions store/redis/rediaron.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package redis

import (
"context"
"errors"
"fmt"
"strings"
"testing"
Expand All @@ -14,7 +13,7 @@ import (
"github.com/projecteru2/core/utils"

"github.com/go-redis/redis/v8"
perrors "github.com/pkg/errors"
"github.com/pkg/errors"
)

var (
Expand Down Expand Up @@ -134,7 +133,7 @@ func (r *Rediaron) KNotify(ctx context.Context, pattern string) chan *KNotifyMes
func (r *Rediaron) GetOne(ctx context.Context, key string) (string, error) {
value, err := r.cli.Get(ctx, key).Result()
if isRedisNoKeyError(err) {
return "", perrors.WithMessage(err, fmt.Sprintf("Key not found: %s", key))
return "", errors.WithMessage(err, fmt.Sprintf("Key not found: %s", key))
}
return value, err
}
Expand Down Expand Up @@ -169,7 +168,7 @@ func (r *Rediaron) GetMulti(ctx context.Context, keys []string) (map[string]stri
}

if isRedisNoKeyError(c.Err()) {
return nil, perrors.WithMessage(err, fmt.Sprintf("Key not found: %s", key))
return nil, errors.WithMessage(err, fmt.Sprintf("Key not found: %s", key))
}

data[key] = c.Val()
Expand Down

0 comments on commit d8ac04c

Please sign in to comment.