Skip to content

Commit ef11869

Browse files
committed
remove unneeded dependencies
- xerrors is obsolete and no longer needed - go-detect-race is no longer needed as this only saves about 1s with recent golang versions
1 parent 5cbb5e8 commit ef11869

File tree

5 files changed

+3
-29
lines changed

5 files changed

+3
-29
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ module github.com/ipfs/go-datastore
22

33
require (
44
github.com/google/uuid v1.6.0
5-
github.com/ipfs/go-detect-race v0.0.1
65
github.com/ipfs/go-ipfs-delay v0.0.1
76
github.com/jbenet/goprocess v0.1.4
87
go.opentelemetry.io/otel v1.16.0
98
go.opentelemetry.io/otel/trace v1.16.0
109
go.uber.org/multierr v1.11.0
11-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
1210
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15
1311
)
1412

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
99
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1010
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
1111
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
12-
github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk=
13-
github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps=
1412
github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ=
1513
github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw=
1614
github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA=
@@ -33,8 +31,6 @@ go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZE
3331
go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0=
3432
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
3533
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
36-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
37-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
3834
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
3935
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4036
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

retrystore/retrystore.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ package retrystore
44

55
import (
66
"context"
7+
"fmt"
78
"time"
89

910
ds "github.com/ipfs/go-datastore"
10-
xerrors "golang.org/x/xerrors"
1111
)
1212

1313
// Datastore wraps a Batching datastore with a
@@ -28,8 +28,6 @@ var _ ds.Datastore = (*Datastore)(nil)
2828
var _ ds.Batching = (*Datastore)(nil)
2929
var _ ds.PersistentDatastore = (*Datastore)(nil)
3030

31-
var errFmtString = "ran out of retries trying to get past temporary error: %w"
32-
3331
func (d *Datastore) runOp(op func() error) error {
3432
err := op()
3533
if err == nil || !d.TempErrFunc(err) {
@@ -45,7 +43,7 @@ func (d *Datastore) runOp(op func() error) error {
4543
}
4644
}
4745

48-
return xerrors.Errorf(errFmtString, err)
46+
return fmt.Errorf("ran out of retries trying to get past temporary error: %w", err)
4947
}
5048

5149
// DiskUsage implements the PersistentDatastore interface.

test/basic_tests.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
"strings"
1010
"testing"
1111

12-
detectrace "github.com/ipfs/go-detect-race"
13-
1412
dstore "github.com/ipfs/go-datastore"
1513
dsq "github.com/ipfs/go-datastore/query"
1614
)
@@ -20,14 +18,6 @@ import (
2018
// 20, 30, 40... and at least to 20.
2119
var ElemCount = 100
2220

23-
func init() {
24-
// Reduce the default element count when the race detector is enabled so these tests don't
25-
// take forever.
26-
if detectrace.WithRace() {
27-
ElemCount = 20
28-
}
29-
}
30-
3121
func TestElemCount(t *testing.T) {
3222
if ElemCount < 20 {
3323
t.Fatal("ElemCount should be set to 20 at least")

test/suite.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
"runtime"
77
"testing"
88

9-
detectrace "github.com/ipfs/go-detect-race"
10-
119
dstore "github.com/ipfs/go-datastore"
1210
query "github.com/ipfs/go-datastore/query"
1311
)
@@ -23,13 +21,7 @@ var BasicSubtests = []func(t *testing.T, ds dstore.Datastore){
2321
SubtestManyKeysAndQuery,
2422
SubtestReturnSizes,
2523
SubtestBasicSync,
26-
}
27-
28-
// Only enable the expensive "combinations" test when not running the race detector.
29-
func init() {
30-
if !detectrace.WithRace() {
31-
BasicSubtests = append(BasicSubtests, SubtestCombinations)
32-
}
24+
SubtestCombinations,
3325
}
3426

3527
// BatchSubtests is a list of all basic batching datastore tests.

0 commit comments

Comments
 (0)