diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2022-10-16 19:13:41 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2022-10-16 19:16:35 +0200 |
commit | eb1b7d7d9149114eb6b4287b7cb40c49dccfb26e (patch) | |
tree | 12f797651abeda9512d56d8922199ae9edb2a293 /pipe/pipe_test.go | |
parent | 98844247a424558939228b82e9b5f28d723c4fe0 (diff) | |
download | porg-master.tar.gz porg-master.tar.bz2 porg-master.zip |
With this is easier to interact with storage layers.
Diffstat (limited to 'pipe/pipe_test.go')
-rw-r--r-- | pipe/pipe_test.go | 15 |
1 files changed, 8 insertions, 7 deletions
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) { |