Skip to content

Commit

Permalink
Merge pull request #10 from bogdandrutu/golibv3
Browse files Browse the repository at this point in the history
Remove dependecy to old github.com/signalfx/golib (v2)
  • Loading branch information
benkeith-splunk authored Jul 16, 2021
2 parents 54b28d4 + b7b95e7 commit c4bd930
Show file tree
Hide file tree
Showing 344 changed files with 96,064 additions and 47,431 deletions.
4 changes: 1 addition & 3 deletions embetcd/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"net/url"
"testing"
"time"

"github.com/signalfx/golib/pointer"
)

func Test_WaitForStructChOrErrCh(t *testing.T) {
Expand Down Expand Up @@ -84,7 +82,7 @@ func Test_duration(t *testing.T) {
{
name: "expect default to be returned when incoming value is nil",
args: args{
in: pointer.Duration(time.Second * 1),
in: pointerDuration(time.Second * 1),
def: time.Second * 5,
},
want: time.Second * 1,
Expand Down
28 changes: 16 additions & 12 deletions embetcd/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
"github.com/coreos/etcd/pkg/transport"
"github.com/coreos/etcd/pkg/types"
"github.com/signalfx/golib/pointer"
)

// helper function to get an etcd config with default values and then overwrite what we want
Expand Down Expand Up @@ -164,10 +163,10 @@ func TestNew(t *testing.T) {
},
}),
wantStartErr: true,
startTimeout: pointer.Duration(time.Second * 5),
startTimeout: pointerDuration(time.Second * 5),
},
},
stopTimeout: pointer.Duration(time.Second * 1),
stopTimeout: pointerDuration(time.Second * 1),
},
{
// ports 24XX
Expand All @@ -194,7 +193,7 @@ func TestNew(t *testing.T) {
}),
},
},
stopTimeout: pointer.Duration(time.Second * 1),
stopTimeout: pointerDuration(time.Second * 1),
},
{
// ports 25XX, 26XX
Expand Down Expand Up @@ -243,7 +242,7 @@ func TestNew(t *testing.T) {
}),
},
},
stopTimeout: pointer.Duration(time.Second * 30),
stopTimeout: pointerDuration(time.Second * 30),
},
{
// ports 27XX, 28XX
Expand Down Expand Up @@ -293,7 +292,7 @@ func TestNew(t *testing.T) {
wantStartErr: true,
},
},
stopTimeout: pointer.Duration(time.Second * 1),
stopTimeout: pointerDuration(time.Second * 1),
},
{
// ports 29XX, 30XX
Expand Down Expand Up @@ -339,11 +338,11 @@ func TestNew(t *testing.T) {
InitialCluster: []string{"http://127.0.0.1:2970", "http://127.0.0.1:3070"},
}),
// set a short timeout since this is an error case
startTimeout: pointer.Duration(time.Second * 5),
startTimeout: pointerDuration(time.Second * 5),
wantStartErr: true,
},
},
stopTimeout: pointer.Duration(time.Second * 1),
stopTimeout: pointerDuration(time.Second * 1),
},
{
// ports 31XX, 32XX, 33XX
Expand Down Expand Up @@ -413,7 +412,7 @@ func TestNew(t *testing.T) {
}),
},
},
stopTimeout: pointer.Duration(time.Second * 30),
stopTimeout: pointerDuration(time.Second * 30),
},
{
// ports 34XX, 34XX intentional conflict
Expand Down Expand Up @@ -459,11 +458,11 @@ func TestNew(t *testing.T) {
InitialCluster: []string{"http://127.0.0.1:3470"},
}),
// set a short timeout since this is an error case
startTimeout: pointer.Duration(time.Second * 30),
startTimeout: pointerDuration(time.Second * 30),
wantStartErr: true,
},
},
stopTimeout: pointer.Duration(time.Second * 1),
stopTimeout: pointerDuration(time.Second * 1),
},
}
for _, tt := range tests {
Expand Down Expand Up @@ -762,7 +761,7 @@ func TestServer_cleanUpStart(t *testing.T) {
}),
},
},
stopTimeout: pointer.Duration(time.Second * 1),
stopTimeout: pointerDuration(time.Second * 1),
},
}
for _, tt := range tests {
Expand Down Expand Up @@ -1144,3 +1143,8 @@ func Test_shouldKeepLeaseAlive(t *testing.T) {
})
}
}

// pointerDuration returns a pointer to a time.Duration
func pointerDuration(d time.Duration) *time.Duration {
return &d
}
40 changes: 14 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
module github.com/signalfx/embetcd

require (
4d63.com/gochecknoglobals v0.0.0-20190306162314-7c3491d2b6ec // indirect
4d63.com/gochecknoinits v0.0.0-20180528051558-14d5915061e5 // indirect
github.com/alecthomas/gocyclo v0.0.0-20150208221726-aa8f8b160214 // indirect
github.com/alexflint/go-arg v1.0.0 // indirect
github.com/alexkohler/nakedret v0.0.0-20171106223215-c0e305a4f690 // indirect
github.com/coreos/bbolt v1.3.2 // indirect
github.com/coreos/etcd v3.3.12+incompatible
github.com/coreos/go-semver v0.2.0 // indirect
github.com/coreos/go-systemd v0.0.0-20190212144455-93d5ec2c7f76 // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/lint v0.0.0-20190301231843-5614ed5bae6f // indirect
github.com/golang/protobuf v1.3.0 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
github.com/golang/protobuf v1.3.5 // indirect
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c // indirect
github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.7.0 // indirect
github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/mdempsky/maligned v0.0.0-20180708014732-6e39bd26a8c8 // indirect
github.com/mdempsky/unconvert v0.0.0-20190117010209-2db5a8ead8e7 // indirect
github.com/mibk/dupl v1.0.0 // indirect
github.com/opennota/check v0.0.0-20180911053232-0c771f5545ff // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v0.9.2 // indirect
github.com/securego/gosec v0.0.0-20190306071850-2bd007e96860 // indirect
github.com/signalfx/golib v2.3.1+incompatible
github.com/sirupsen/logrus v1.3.0 // indirect
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/stripe/safesql v0.0.0-20171221195208-cddf355596fe // indirect
github.com/stretchr/testify v1.6.1 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/tsenart/deadcode v0.0.0-20160724212837-210d2dc333e9 // indirect
github.com/ugorji/go v1.1.1 // indirect
github.com/walle/lll v0.0.0-20160702150637-8b13b3fbf731 // indirect
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.4 // indirect
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.9.1 // indirect
golang.org/x/crypto v0.0.0-20190227175134-215aa809caaf // indirect
golang.org/x/net v0.0.0-20190227160552-c95aed5357e7 // indirect
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 // indirect
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
google.golang.org/grpc v1.19.0 // indirect
gopkg.in/yaml.v2 v2.2.2 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
mvdan.cc/unparam v0.0.0-20190310220240-1b9ccfa71afe // indirect
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
google.golang.org/grpc v1.20.1 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.5 // indirect
)
Loading

0 comments on commit c4bd930

Please sign in to comment.