From eb1b7d7d9149114eb6b4287b7cb40c49dccfb26e Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Sun, 16 Oct 2022 19:13:41 +0200 Subject: feat: Add storage interface With this is easier to interact with storage layers. --- pipe/pipe_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'pipe/pipe_test.go') diff --git a/pipe/pipe_test.go b/pipe/pipe_test.go index e71b05b..950d039 100644 --- a/pipe/pipe_test.go +++ b/pipe/pipe_test.go @@ -20,12 +20,12 @@ func createCountPipe() <-chan int { return cout } -func multiply(in int) int { - return in * Multiplier +func multiply(in int) (int, error) { + return in * Multiplier, nil } -func devide(in int) int { - return in / Multiplier +func devide(in int) (int, error) { + return in / Multiplier, nil } func TestProc(t *testing.T) { @@ -81,13 +81,14 @@ func createBuffers() []*buffer { return buffers } -func multiplyBuffer(in *buffer) *buffer { +func multiplyBuffer(in *buffer) (*buffer, error) { in.value = in.value * Multiplier - return in + return in, nil } -func devideBuffer(in *buffer) { +func devideBuffer(in *buffer) error { in.value = in.value / Multiplier + return nil } func TestTailProc(t *testing.T) { -- cgit v1.2.3