diff --git a/_examples/basic/main.go b/_examples/basic/main.go index 63c106ce..0fbe4315 100644 --- a/_examples/basic/main.go +++ b/_examples/basic/main.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/GopeedLab/gopeed/pkg/base" "github.com/GopeedLab/gopeed/pkg/download" + "github.com/GopeedLab/gopeed/pkg/protocol/http" ) func main() { @@ -16,7 +17,9 @@ func main() { } }). Create(&base.Options{ - Connections: 8, + Extra: http.OptsExtra{ + Connections: 8, + }, }) if err != nil { panic(err) diff --git a/cmd/gopeed/main.go b/cmd/gopeed/main.go index 251c89f3..e9d55d38 100644 --- a/cmd/gopeed/main.go +++ b/cmd/gopeed/main.go @@ -13,9 +13,17 @@ import ( const progressWidth = 20 func main() { - args := parse() + //args := parse() + var dir = "./" + var connections = 8 + args := &args{ + url: "https://sel-kor-ping.vultr.com/vultr.com.100MB.bin", + dir: &dir, + connections: &connections, + } var wg sync.WaitGroup + wg.Add(1) _, err := download.Boot(). URL(args.url). Listener(func(event *download.Event) { @@ -46,7 +54,6 @@ func main() { if err != nil { panic(err) } - wg.Add(1) wg.Wait() }