-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathinit.go
More file actions
23 lines (20 loc) · 665 Bytes
/
Copy pathinit.go
File metadata and controls
23 lines (20 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package gorc
import (
"flag"
"os"
)
var thread int64
var manual bool
var root string
var netUrl string
var blockSize int64
var attempt int
func init() {
flag.Int64Var(&thread, "thread", 5, "concurrent thread number")
flag.BoolVar(&manual, "manual", false, "specific thread number or not")
flag.StringVar(&netUrl, "url", "http://golangtc.com/static/go/1.8beta1/go1.8beta1.darwin-amd64.pkg", "request url")
flag.Int64Var(&blockSize, "blockSize", 1, "temp file size, one is 16m,two is 32m......")
flag.IntVar(&attempt, "attempt", 3, "if download failed,attempt time")
r, _ := os.Getwd()
flag.StringVar(&root, "root", r+"/lib", "file download directory")
}