Skip to content

Commit

Permalink
Update event.go
Browse files Browse the repository at this point in the history
  • Loading branch information
coder543 authored Apr 7, 2019
1 parent 5e66ec2 commit 5275b97
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,7 @@ func (e *Event) Write(p []byte) (int, error) {

// WriteString adds string data to the event.
// Equivalent to calling Write([]byte(string))
// Panics if provided with non-ascii input
func (e *Event) WriteString(p string) {
// check ASCII
for _, c := range p {
if c > unicode.MaxASCII {
// TODO at next major version bump, convert this to return an error
// instead of a blind panic
panic("eventsource: WriteString: Attempt to write non-ascii string")
}
}
// split event on newlines
split := strings.Split(p, "\n")
for _, entry := range split {
Expand Down

0 comments on commit 5275b97

Please sign in to comment.