Skip to content

Commit 6574c77

Browse files
committed
bufset logic
1 parent 071cc31 commit 6574c77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

event.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@ type Event struct {
2020
// ID sets the event ID
2121
func (e *Event) ID(id string) *Event {
2222
e.id = id
23+
e.bufSet = false
2324
return e
2425
}
2526

2627
// Type sets the event's event: field
2728
func (e *Event) Type(t string) *Event {
2829
e.event = t
30+
e.bufSet = false
2931
return e
3032
}
3133

3234
// Type sets the event's retry: field
3335
func (e *Event) Retry(t uint64) *Event {
3436
e.retry = t
37+
e.bufSet = false
3538
return e
3639
}
3740

@@ -124,6 +127,7 @@ func (e *Event) WriteString(p string) {
124127
// This does no validation to ensure it is in a correct format
125128
// and should mostly be used to deep copy another event
126129
func (e *Event) WriteRaw(p []byte) (int, error) {
130+
e.bufSet = true
127131
return e.buf.Write(p)
128132
}
129133

0 commit comments

Comments
 (0)