From 0594441d694bf3cf3328c88f1bce11358dd90aab Mon Sep 17 00:00:00 2001 From: Simon Richardson Date: Wed, 20 Sep 2023 12:13:56 +0100 Subject: [PATCH] Update version - v4 This is a breaking change, so we should bump from v3 to v4. --- Makefile | 2 +- catacomb/catacomb.go | 2 +- catacomb/catacomb_test.go | 4 ++-- catacomb/fixture_test.go | 4 ++-- dependency/engine.go | 2 +- dependency/engine_test.go | 6 +++--- dependency/interface.go | 2 +- dependency/reporter_test.go | 4 ++-- dependency/self_test.go | 4 ++-- dependency/snapshot.go | 2 +- dependency/testing/stub.go | 2 +- dependency/util.go | 2 +- dependency/util_test.go | 6 +++--- go.mod | 4 ++-- runner_test.go | 2 +- worker_test.go | 2 +- workertest/check.go | 20 ++++++++++---------- workertest/fake_watcher.go | 2 +- workertest/workers.go | 2 +- workertest/workertest_test.go | 2 +- 20 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index 912e360..f811f2b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PROJECT := github.com/juju/worker/v3 +PROJECT := github.com/juju/worker/v4 .PHONY: check-licence check-go check diff --git a/catacomb/catacomb.go b/catacomb/catacomb.go index 0d333c7..31a4e2f 100644 --- a/catacomb/catacomb.go +++ b/catacomb/catacomb.go @@ -14,7 +14,7 @@ import ( "github.com/juju/errors" "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) // Catacomb is a variant of tomb.Tomb with its own internal goroutine, designed diff --git a/catacomb/catacomb_test.go b/catacomb/catacomb_test.go index 6db34d5..c58b96b 100644 --- a/catacomb/catacomb_test.go +++ b/catacomb/catacomb_test.go @@ -13,8 +13,8 @@ import ( gc "gopkg.in/check.v1" "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" - "github.com/juju/worker/v3/catacomb" + "github.com/juju/worker/v4" + "github.com/juju/worker/v4/catacomb" ) type CatacombSuite struct { diff --git a/catacomb/fixture_test.go b/catacomb/fixture_test.go index 9fa2ed4..0370dd5 100644 --- a/catacomb/fixture_test.go +++ b/catacomb/fixture_test.go @@ -11,8 +11,8 @@ import ( gc "gopkg.in/check.v1" "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" - "github.com/juju/worker/v3/catacomb" + "github.com/juju/worker/v4" + "github.com/juju/worker/v4/catacomb" ) type cleaner interface { diff --git a/dependency/engine.go b/dependency/engine.go index f2862f3..ce03911 100644 --- a/dependency/engine.go +++ b/dependency/engine.go @@ -14,7 +14,7 @@ import ( "github.com/juju/errors" "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) // Logger represents the various logging methods used by the runner. diff --git a/dependency/engine_test.go b/dependency/engine_test.go index 03f257a..c7e3629 100644 --- a/dependency/engine_test.go +++ b/dependency/engine_test.go @@ -15,9 +15,9 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/worker/v3" - "github.com/juju/worker/v3/dependency" - "github.com/juju/worker/v3/workertest" + "github.com/juju/worker/v4" + "github.com/juju/worker/v4/dependency" + "github.com/juju/worker/v4/workertest" ) type EngineSuite struct { diff --git a/dependency/interface.go b/dependency/interface.go index 537b744..691cedb 100644 --- a/dependency/interface.go +++ b/dependency/interface.go @@ -8,7 +8,7 @@ import ( "github.com/juju/errors" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) // Manifold defines the behaviour of a node in an Engine's dependency graph. It's diff --git a/dependency/reporter_test.go b/dependency/reporter_test.go index e4679f6..f898e31 100644 --- a/dependency/reporter_test.go +++ b/dependency/reporter_test.go @@ -11,8 +11,8 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/worker/v3/dependency" - "github.com/juju/worker/v3/workertest" + "github.com/juju/worker/v4/dependency" + "github.com/juju/worker/v4/workertest" ) type ReportSuite struct { diff --git a/dependency/self_test.go b/dependency/self_test.go index 1ed68af..7e24c54 100644 --- a/dependency/self_test.go +++ b/dependency/self_test.go @@ -11,8 +11,8 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/worker/v3/dependency" - "github.com/juju/worker/v3/workertest" + "github.com/juju/worker/v4/dependency" + "github.com/juju/worker/v4/workertest" ) type SelfSuite struct { diff --git a/dependency/snapshot.go b/dependency/snapshot.go index 7983d3c..915f652 100644 --- a/dependency/snapshot.go +++ b/dependency/snapshot.go @@ -9,7 +9,7 @@ import ( "github.com/juju/errors" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) // snapshot encapsulates a snapshot of workers and output funcs and implements diff --git a/dependency/testing/stub.go b/dependency/testing/stub.go index 9b7afb1..62d0065 100644 --- a/dependency/testing/stub.go +++ b/dependency/testing/stub.go @@ -10,7 +10,7 @@ import ( "github.com/juju/errors" - "github.com/juju/worker/v3/dependency" + "github.com/juju/worker/v4/dependency" ) // NewStubResource creates a single StubResource with the given diff --git a/dependency/util.go b/dependency/util.go index baa40ca..1af290c 100644 --- a/dependency/util.go +++ b/dependency/util.go @@ -8,7 +8,7 @@ import ( "github.com/juju/errors" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) // Installer exposes an Engine's Install method. diff --git a/dependency/util_test.go b/dependency/util_test.go index 28cd2a8..c449c47 100644 --- a/dependency/util_test.go +++ b/dependency/util_test.go @@ -14,9 +14,9 @@ import ( gc "gopkg.in/check.v1" "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" - "github.com/juju/worker/v3/dependency" - "github.com/juju/worker/v3/workertest" + "github.com/juju/worker/v4" + "github.com/juju/worker/v4/dependency" + "github.com/juju/worker/v4/workertest" ) type engineFixture struct { diff --git a/go.mod b/go.mod index f924f4a..398fe99 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module github.com/juju/worker/v3 +module github.com/juju/worker/v4 -go 1.19 +go 1.20 require ( github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a diff --git a/runner_test.go b/runner_test.go index cce1ca2..2f4a35e 100644 --- a/runner_test.go +++ b/runner_test.go @@ -17,7 +17,7 @@ import ( gc "gopkg.in/check.v1" "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) type RunnerSuite struct { diff --git a/worker_test.go b/worker_test.go index 9cf1602..f3a4b06 100644 --- a/worker_test.go +++ b/worker_test.go @@ -10,7 +10,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) type WorkerSuite struct { diff --git a/workertest/check.go b/workertest/check.go index 755347e..605ab06 100644 --- a/workertest/check.go +++ b/workertest/check.go @@ -11,7 +11,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) var ( @@ -71,9 +71,9 @@ func CheckKill(c *gc.C, w worker.Worker) error { // CleanKill calls CheckKill with the supplied arguments, and Checks that the // returned error is nil. It's particularly suitable for deferring: // -// someWorker, err := some.NewWorker() -// c.Assert(err, jc.ErrorIsNil) -// defer workertest.CleanKill(c, someWorker) +// someWorker, err := some.NewWorker() +// c.Assert(err, jc.ErrorIsNil) +// defer workertest.CleanKill(c, someWorker) // // ...in the large number (majority?) of situations where a worker is expected // to run successfully; and it doesn't Assert, and is therefore suitable for use @@ -86,9 +86,9 @@ func CleanKill(c *gc.C, w worker.Worker) { // DirtyKill calls CheckKill with the supplied arguments, and logs the returned // error. It's particularly suitable for deferring: // -// someWorker, err := some.NewWorker() -// c.Assert(err, jc.ErrorIsNil) -// defer workertest.DirtyKill(c, someWorker) +// someWorker, err := some.NewWorker() +// c.Assert(err, jc.ErrorIsNil) +// defer workertest.DirtyKill(c, someWorker) // // ...in the cases where we expect a worker to fail, but aren't specifically // testing that failure; and it doesn't Assert, and is therefore suitable for @@ -104,9 +104,9 @@ func DirtyKill(c *gc.C, w worker.Worker) { // and tries to stop the (non-nil) worker via CleanKill(). It's suitable // for testing constructor failure: // -// someWorker, err := some.NewWorker(badConfig) -// workertest.CheckNilOrKill(c, someWorker) -// c.Check(err, ... +// someWorker, err := some.NewWorker(badConfig) +// workertest.CheckNilOrKill(c, someWorker) +// c.Check(err, ... // // ...because it will do the right thing if your constructor succeeds // unexpectedly, and make every effort to prevent a rogue worker living diff --git a/workertest/fake_watcher.go b/workertest/fake_watcher.go index 66a0b8e..26b1bba 100644 --- a/workertest/fake_watcher.go +++ b/workertest/fake_watcher.go @@ -6,7 +6,7 @@ package workertest import ( "errors" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) type NotAWatcher struct { diff --git a/workertest/workers.go b/workertest/workers.go index f575484..36355a6 100644 --- a/workertest/workers.go +++ b/workertest/workers.go @@ -6,7 +6,7 @@ package workertest import ( "gopkg.in/tomb.v2" - "github.com/juju/worker/v3" + "github.com/juju/worker/v4" ) // NewErrorWorker returns a Worker that runs until Kill()ed; at which point it diff --git a/workertest/workertest_test.go b/workertest/workertest_test.go index 48001e0..67c7e36 100644 --- a/workertest/workertest_test.go +++ b/workertest/workertest_test.go @@ -10,7 +10,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/worker/v3/workertest" + "github.com/juju/worker/v4/workertest" ) type Suite struct {