FAQ
Hi Jesse,

Thanks for your FIXME :)
https://github.com/xiangzhai/goaxel/blob/master/conn/http.go#L142

Leslie
On Thu, Nov 28, 2013 at 2:07 PM, Leslie Zhai wrote:

Hi Nigel,

Thanks for your advice, I reduced make byte array times :)
https://github.com/xiangzhai/goaxel/blob/master/conn/http.go#L128

I chosed outputFile.WriteAt(data[:n], int64(http.offset)) now,
directly WriteAt data with offset into output file, it does not
need to make chunk files any more


n, err := http.conn.Read(data)

if err != nil {

return
}
You're still not handling the Read() correctly.
if 'err' is io.EOF, 'n' could be more than zero and thus you'd throw
away the end of the data.

You should check the value of 'n' before looking at the error value.

You should read the docs for io.Reader, http://golang.org/pkg/io/#Reader
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 11 of 13 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 27, '13 at 10:15a
activeApr 15, '14 at 10:08a
posts13
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase