From c9b618ab48acd08b794852115520537202eed7d5 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Fri, 20 Feb 2015 14:49:36 -0500 Subject: [PATCH] main.go: actually write the _post_ buffer ... --- main.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index fcfb79c..59cd225 100644 --- a/main.go +++ b/main.go @@ -45,19 +45,23 @@ func main() { } break } + pre := tr.RawBytes() output.Write(pre) + sum += int64(len(pre)) + var i int64 if i, err = io.Copy(output, tr); err != nil { log.Println(err) break } - post := tr.RawBytes() - output.Write(pre) - fmt.Println(hdr.Name, "pre:", len(pre), "read:", i, "post:", len(post)) - sum += int64(len(pre)) sum += i + + post := tr.RawBytes() + output.Write(post) sum += int64(len(post)) + + fmt.Println(hdr.Name, "pre:", len(pre), "read:", i, "post:", len(post)) } if size != sum {