From b4c4be1f22dafb7e2c06992b146459b6bc586c58 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 19 Oct 2022 12:21:18 +0200 Subject: [PATCH] Revert "testutil/registry: remove unused WithStdout(), WithStErr() opts" This reverts commit 1f21c4dd0512e899ecf4077a927d99debac28f6d. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 92eca900b086200b4f270cf438a8a5ff9c8c2a3b) Signed-off-by: Sebastiaan van Stijn --- testutil/registry/ops.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testutil/registry/ops.go b/testutil/registry/ops.go index c004f37424..7357d5f509 100644 --- a/testutil/registry/ops.go +++ b/testutil/registry/ops.go @@ -1,5 +1,7 @@ package registry +import "io" + // Schema1 sets the registry to serve v1 api func Schema1(c *Config) { c.schema1 = true @@ -24,3 +26,17 @@ func URL(registryURL string) func(*Config) { c.registryURL = registryURL } } + +// WithStdout sets the stdout of the registry command to the passed in writer. +func WithStdout(w io.Writer) func(c *Config) { + return func(c *Config) { + c.stdout = w + } +} + +// WithStderr sets the stdout of the registry command to the passed in writer. +func WithStderr(w io.Writer) func(c *Config) { + return func(c *Config) { + c.stderr = w + } +}