summaryrefslogtreecommitdiff
path: root/unxml.go
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2015-01-18 20:00:25 +0100
committerSilvan Jegen <s.jegen@gmail.com>2015-01-18 20:36:54 +0100
commit68707bbd9e45f4ec28abc7f099fbf72980545070 (patch)
tree2749bf305e59f1f9e371b041621d318dd3732f6c /unxml.go
parentaf7a90d550c98b3c6610c121ae49d9abf943fdaa (diff)
Clean up
Diffstat (limited to 'unxml.go')
-rw-r--r--unxml.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/unxml.go b/unxml.go
index f5b7c62..c34f29f 100644
--- a/unxml.go
+++ b/unxml.go
@@ -3,7 +3,6 @@
package unxml
import (
- "bytes"
"fmt"
"io"
"os"
@@ -56,8 +55,6 @@ func (r *Reader) Read(out []byte) (int, error) {
lenout -= n
}
- buf := bytes.NewBuffer(out)
-
for {
tt := r.tokenizer.Next()
@@ -70,16 +67,15 @@ func (r *Reader) Read(out []byte) (int, error) {
text := r.tokenizer.Text()
lentext := len(text)
if lentext <= lenout {
- //n, err = buf.Write(r.tokenizer.Text())
n = copy(out[r.count:], text)
r.count += n
lenout -= n
- fmt.Printf("HAD SPACE: n, err: %d, %s; out: %s; buf: %s\n", n, err, out, buf)
+ //fmt.Printf("HAD SPACE: %q, count: %d, err: %s\n", text, r.count, err)
} else {
n = copy(out[r.count:], text[:lenout-1])
r.count += n
r.lastread = text[lenout-1:]
- fmt.Printf("HAD NO SPACE: n, err: %d, %s; out: %s; buf: %s\n", n, err, out, buf)
+ //fmt.Printf("HAD NO SPACE: count: %d, err: %s\n", r.count, err)
return r.count, err
}
@@ -88,6 +84,4 @@ func (r *Reader) Read(out []byte) (int, error) {
//fmt.Printf("TagName: %s\n", tn)
}
}
-
- return r.count, err
}