docs: add example

This commit is contained in:
liwei committed 2021-03-26 16:22:53 +08:00
1 parent 01501ca857
commit 936e193c20
10 files changed
+120 -143

No files matched your search

+2 -2
View File
@@ -53,8 +53,8 @@ func TestDownloader_Create(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
downloader.Listener(func(taskInfo *TaskInfo, eventKey EventKey) {
if eventKey == EventKeyDone {
downloader.Listener(func(event *Event) {
if event.Key == EventKeyDone {
wg.Done()
}
})