g2s icon indicating copy to clipboard operation
g2s copied to clipboard

Code is stripping \n

Open adamsch1 opened this issue 9 years ago • 1 comments

Howdy - Love g2s. Was using g2s.New to pass in my own buffered io.Writer implementation so I could send multiple commands in one underlying write call. statsd was complaining and I realized eventually it was because the \n was not being sent.

Tracked it down to this line of code which is a function of dealing with larger than 64K messages:

https://github.com/peterbourgon/g2s/blob/master/g2s.go#L69

Simply getting rid of the -1 got things working. The reference implementation of statsd supports mulitple commands per packet deliminated by newline so this should get that working.

I can send a pull request if you like.

adamsch1 avatar Jan 11 '16 22:01 adamsch1

Sure. Just make sure to update tests :)

peterbourgon avatar Feb 23 '17 12:02 peterbourgon