mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-05 16:15:43 +00:00
fix: gopeed cli negative WaitGroup counter error (#110)
This commit is contained in:
1 parent
09bdb5584a
commit
34bcbd9571
2 files changed
+13
-3
No files matched your search
@@ -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)
|
||||
|
||||
+9
-2
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user