I haven't fully read this patch, but it looks like this reimplements go's ReadLine() method with respect to partial detection. Is there a bug we should file upstream to the Go developers? Put differently, what caused this to need reimplementing of is_partial?