Revert "publisher: Get the collector in line with the io.Writer interface"

This reverts commit a9bcd38181.
This commit is contained in:
Bjørn Erik Pedersen 2021-05-19 03:45:30 +02:00
parent a9bcd38181
commit 3f515f0e33
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -152,21 +152,18 @@ type htmlElementsCollectorWriter struct {
} }
// Write collects HTML elements from p. // Write collects HTML elements from p.
func (w *htmlElementsCollectorWriter) Write(p []byte) (int, error) { func (w *htmlElementsCollectorWriter) Write(p []byte) (n int, err error) {
n = len(p)
w.input = p w.input = p
w.pos = 0
for { for {
w.r = w.next() w.r = w.next()
if w.r == eof { if w.r == eof {
break return
} }
w.state = w.state(w) w.state = w.state(w)
} }
w.pos = 0
w.input = nil
return len(p), nil
} }
func (l *htmlElementsCollectorWriter) backup() { func (l *htmlElementsCollectorWriter) backup() {