logtail, net/portmapper, wgengine/magicsock: use fmt.Appendf
Fixes #5206 Change-Id: I490bb92e774ce7c044040537e2cd864fcf1dbe5a Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
4aa88bc2c0
commit
5381437664
@ -5,7 +5,6 @@
|
||||
package logtail
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
@ -51,9 +50,7 @@ func (m *memBuffer) TryReadLine() ([]byte, error) {
|
||||
case ent := <-m.pending:
|
||||
if ent.dropCount > 0 {
|
||||
m.next = ent.msg
|
||||
buf := new(bytes.Buffer)
|
||||
fmt.Fprintf(buf, "----------- %d logs dropped ----------", ent.dropCount)
|
||||
return buf.Bytes(), nil
|
||||
return fmt.Appendf(nil, "----------- %d logs dropped ----------", ent.dropCount), nil
|
||||
}
|
||||
return ent.msg, nil
|
||||
default:
|
||||
|
Reference in New Issue
Block a user