Tweak readall allocation and renameData buffer reuse (#13108)

Use a single allocation for reading the file, not the growing buffer of `io.ReadAll`.

Reuse the write buffer if we can when writing metadata in RenameData.
This commit is contained in:
Klaus Post
2021-08-30 17:38:11 +02:00
committed by GitHub
parent 88e0aa1cb2
commit 470553ff5d
3 changed files with 10 additions and 4 deletions

View File

@@ -135,7 +135,7 @@ GLOBAL FLAGS:
}
data = b
default:
return errors.New("unknown metadata version")
return fmt.Errorf("unknown metadata version %d", minor)
}
if c.Bool("data") {