From 5703c4859b7eb4b6da2b00a191243abba95032c9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 13 Aug 2020 10:10:56 +0300 Subject: [PATCH] cli: rename readBlock to readBytes It reads only byte slice. --- cli/server/server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/server/server.go b/cli/server/server.go index cd01a074e..59ed18ad8 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -287,7 +287,7 @@ func restoreDB(ctx *cli.Context) error { } i := dumpStart for ; i < start; i++ { - _, err := readBlock(reader) + _, err := readBytes(reader) if err != nil { return cli.NewExitError(err, 1) } @@ -306,7 +306,7 @@ func restoreDB(ctx *cli.Context) error { return cli.NewExitError("cancelled", 1) default: } - bytes, err := readBlock(reader) + bytes, err := readBytes(reader) if err != nil { return cli.NewExitError(err, 1) } @@ -342,8 +342,8 @@ func restoreDB(ctx *cli.Context) error { return nil } -// readBlock performs reading of block size and then bytes with the length equal to that size. -func readBlock(reader *io.BinReader) ([]byte, error) { +// readBytes performs reading of block size and then bytes with the length equal to that size. +func readBytes(reader *io.BinReader) ([]byte, error) { var size = reader.ReadU32LE() bytes := make([]byte, size) reader.ReadBytes(bytes)