kadai3-2 shuheiktgw - #49
Conversation
|
って書いてあるので |
|
テスト書きたかったけど力付きました 😇 |
| ss := strings.Split(u.Path, "/") | ||
| fname := ss[len(ss)-1] | ||
|
|
||
| res, err := http.Head(rawURL) |
There was a problem hiding this comment.
https://developer.mozilla.org/ja/docs/Web/HTTP/Headers/Accept-Ranges
この時点で Accept-Ranges をチェックしておいたほうが良いと思います
There was a problem hiding this comment.
確かに,ありがとうございます!
RangeRequestとNonRangeRequestに分けて扱うようにしました.
|
|
||
| // Do sends a real HTTP requests in parallel | ||
| func (r *Request) Do() error { | ||
| eg, _ := errgroup.WithContext(context.TODO()) |
There was a problem hiding this comment.
https://godoc.org/golang.org/x/sync/errgroup#WithContext
The derived Context is canceled the first time a function passed to Go returns a non-nil error or the first time Wait returns, whichever occurs first.
このcontext.Contextを受け取って、それを利用しないと意味がなくなってしまいます
この場合は http.Request の WithContext を利用して渡すなどの必要があります
|
今更ですが指摘頂いた箇所を修正しました! 🙇 |
遅くなりましたが, 課題3-2を書きました! 🙇
分割ダウンローダを作ろう