From 95b7e05367c81f52c19702922405788606404865 Mon Sep 17 00:00:00 2001 From: Michael Gasch Date: Tue, 8 Feb 2022 16:34:21 +0100 Subject: [PATCH] fix: Return -1 on Write error Closes: #33 Signed-off-by: Michael Gasch --- sharded/log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharded/log.go b/sharded/log.go index 4475052..8d20906 100644 --- a/sharded/log.go +++ b/sharded/log.go @@ -81,7 +81,7 @@ func (l *Log) Write(ctx context.Context, key []byte, data []byte) (memlog.Offset offset, err := l.shards[shard].Write(ctx, data) if err != nil { - return offset, fmt.Errorf("write to shard: %w", err) + return -1, fmt.Errorf("write to shard: %w", err) } return offset, nil