g2s
g2s copied to clipboard
Code is stripping \n
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.
Sure. Just make sure to update tests :)