We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 49a10eb + 40522e0 commit f3be3a1Copy full SHA for f3be3a1
splunk/v2/writer.go
@@ -50,9 +50,13 @@ func (w *Writer) Write(b []byte) (int, error) {
50
w.errors = make(chan error, bufferSize)
51
go w.listen()
52
})
53
+ // Make a local copy of the bytearray so it doesn't get overwritten by
54
+ // the next call to Write()
55
+ var b2 = make([]byte, len(b))
56
+ copy(b2, b)
57
// Send the data to the channel
58
w.dataChan <- &message{
- data: b,
59
+ data: b2,
60
writtenAt: time.Now(),
61
}
62
// We don't know if we've hit any errors yet, so just say we're good
0 commit comments