mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
pkg/tailfile: avoid allocations with (*os.File).WriteString (mirror)
pkg/tailfile/tailfile_test.go:149:16: avoid allocations with (*os.File).WriteString (mirror)
if _, err := f.Write([]byte("tailfile pretty interesting line\n")); err != nil {
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -146,7 +146,7 @@ func BenchmarkTail(b *testing.B) {
|
||||
defer f.Close()
|
||||
defer os.RemoveAll(f.Name())
|
||||
for i := 0; i < 10000; i++ {
|
||||
if _, err := f.Write([]byte("tailfile pretty interesting line\n")); err != nil {
|
||||
if _, err := f.WriteString("tailfile pretty interesting line\n"); err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user