This commit is contained in:
Matt Joiner 2015-10-23 12:42:57 +11:00
parent b8da06a885
commit ea0ccf6a23
1 changed files with 8 additions and 10 deletions

View File

@ -159,19 +159,17 @@ func main() {
} }
go func() { go func() {
defer close(done)
<-t.GotInfo() <-t.GotInfo()
files := t.Files() for _, file := range t.Files() {
for _, file := range files { if file.DisplayPath() != rootGroup.Pick {
if file.Path() == rootGroup.Pick { continue
log.Printf("Downloading file: %s", file.Path())
srcReader := io.NewSectionReader(t.NewReader(), file.Offset(), file.Length())
io.Copy(dstWriter, srcReader)
close(done)
break
} }
srcReader := io.NewSectionReader(t.NewReader(), file.Offset(), file.Length())
io.Copy(dstWriter, srcReader)
return
} }
log.Print("file not found")
}() }()
} }