From 7a5705bf50a5bacd2060e3bdb6fb72cd48e2393f Mon Sep 17 00:00:00 2001 From: Anze Kolar Date: Wed, 8 Jul 2020 14:09:57 +0200 Subject: internal/queue: refactor existing queue creators into queue.New Add a unified function for creating new queues so that separate implementations of newQueue in cmd/frontend and cmd/worker can be removed. Since queue.New contains the necessary logic for deciding between GCP and InMemory, the two could be made unexported after updating the corresponding tests. Fixes golang/go#40097. Change-Id: Ie509ba39ef293cca3ff95f2ce12833339c0542ea Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241477 Reviewed-by: Jonathan Amsterdam --- internal/queue/queue_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/queue/queue_test.go') diff --git a/internal/queue/queue_test.go b/internal/queue/queue_test.go index e1150f13..2e2a1f8c 100644 --- a/internal/queue/queue_test.go +++ b/internal/queue/queue_test.go @@ -52,7 +52,7 @@ func TestNewTaskRequest(t *testing.T) { t.Fatal(err) } const queueID = "queueID" - gcp := NewGCP(cfg, nil, queueID) + gcp := newGCP(cfg, nil, queueID) got := gcp.newTaskRequest("mod", "v1.2.3", "suf", time.Minute) want := &taskspb.CreateTaskRequest{ Parent: "projects/Project/locations/us-central1/queues/" + queueID, -- cgit v1.3-5-g9baa