I think the call to func (e *Event) Write(p []byte) (int, error) { should not convert to a string; it should just do what WriteRaw does, and then remove WriteRaw. Having it actually convert to a string and do all the checks is not the expected behaviour (the caller has WriteString for that purpose).
I think the call to
func (e *Event) Write(p []byte) (int, error) {should not convert to a string; it should just do whatWriteRawdoes, and then removeWriteRaw. Having it actually convert to a string and do all the checks is not the expected behaviour (the caller hasWriteStringfor that purpose).