Why not just use io.MultiWriter(hasher, file)? http://golang.org/pkg/io/#MultiWriterEach write will be stream written to both the hash and the file, then just get the sum when you're done writing?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oh, I return an error when a zero length []byte or nil reader is passed in. Convention is to panic? Please advise.