Skip to content

Commit

Permalink
optimized prompt message
Browse files Browse the repository at this point in the history
  • Loading branch information
Greyh4t committed Jun 10, 2020
1 parent 6cec87f commit e0dd098
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func download(in interface{}) {

statusCode, data, err := ZHTTP.Get(segment.URI, headers, conf.Retry)
if err != nil {
log.Fatalln("[-] Download failed:", err)
log.Fatalln("[-] Download failed:", id, err)
}

if statusCode/100 != 2 || len(data) == 0 {
Expand Down Expand Up @@ -231,7 +231,7 @@ func download(in interface{}) {
}
}

log.Println("[+] Download succed:", segment.URI)
log.Println("[+] Download succed:", id, segment.URI)

JOINER.Join(id, data)
}
Expand Down Expand Up @@ -266,6 +266,8 @@ func main() {
log.Fatalln("[-] Init failed:", err)
}

t := time.Now()

var data []byte
if conf.File != "" {
data, err = ioutil.ReadFile(conf.File)
Expand Down Expand Up @@ -307,6 +309,6 @@ func main() {
if err != nil {
log.Fatalln("[-] Write to file failed:", err)
}
log.Println("[+] Download succed, saved to", JOINER.Name())
log.Println("[+] Download succed, saved to", JOINER.Name(), "cost:", time.Now().Sub(t))
}
}

0 comments on commit e0dd098

Please sign in to comment.