From e5b6d97bcf52ff68f1228761ab4028eafff36ad5 Mon Sep 17 00:00:00 2001 From: Wil Fisher Date: Thu, 4 Aug 2022 13:25:21 +0100 Subject: [PATCH 1/2] Switches the `clock` package to benbjohnson/clock The facebookgo/clock fork is unmaintained. This commit switches to the more actively maintained upstream github.com/benbjohnson/clock. --- circuitbreaker.go | 2 +- circuitbreaker_test.go | 2 +- window.go | 2 +- window_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/circuitbreaker.go b/circuitbreaker.go index dd9bc55..dc20dc3 100644 --- a/circuitbreaker.go +++ b/circuitbreaker.go @@ -38,7 +38,7 @@ import ( "time" "github.com/cenkalti/backoff" - "github.com/facebookgo/clock" + "github.com/benbjohnson/clock" ) // BreakerEvent indicates the type of event received over an event channel diff --git a/circuitbreaker_test.go b/circuitbreaker_test.go index 79aa143..4f212d4 100644 --- a/circuitbreaker_test.go +++ b/circuitbreaker_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/cenkalti/backoff" - "github.com/facebookgo/clock" + "github.com/benbjohnson/clock" ) func init() { diff --git a/window.go b/window.go index ab83187..b3cd620 100644 --- a/window.go +++ b/window.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/facebookgo/clock" + "github.com/benbjohnson/clock" ) var ( diff --git a/window_test.go b/window_test.go index 7b60fbf..41c9609 100644 --- a/window_test.go +++ b/window_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/facebookgo/clock" + "github.com/benbjohnson/clock" ) func TestWindowCounts(t *testing.T) { From d1b85af9cbd162fd4e6ccfaff4d2de78f5cdb4df Mon Sep 17 00:00:00 2001 From: Wil Fisher Date: Thu, 4 Aug 2022 13:25:28 +0100 Subject: [PATCH 2/2] Adds go.mod and go.sum I ran: $ go mod init $ go mod tidy And added the resulting `go.sum` and `go.mod` files --- go.mod | 9 +++++++++ go.sum | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..aa292b1 --- /dev/null +++ b/go.mod @@ -0,0 +1,9 @@ +module github.com/rubyist/circuitbreaker + +go 1.18 + +require ( + github.com/benbjohnson/clock v1.3.0 + github.com/cenkalti/backoff v2.2.1+incompatible + github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..184f26d --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk= +github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg=