From c933c7df26358efe076e30df15ef5dd72163a13d Mon Sep 17 00:00:00 2001 From: xiemalin Date: Tue, 30 Jun 2020 21:43:15 +0800 Subject: [PATCH] update doc --- README.md | 2 +- main/main.go | 2 +- main/main_async.go | 2 +- utils.go | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a12e93..aa78c52 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ func main() { } defer queue.Close() - data := []byte("hello xiemalin") + data := []byte("hello jhunters") i, err := queue.Enqueue(data) if err != nil { diff --git a/main/main.go b/main/main.go index 3350a52..2e9abfc 100644 --- a/main/main.go +++ b/main/main.go @@ -28,7 +28,7 @@ func main() { // do enqueue for i := 1; i < 10; i++ { - data := []byte("hello xiemalin" + strconv.Itoa(i)) + data := []byte("hello jhunters" + strconv.Itoa(i)) i, err := queue.Enqueue(data) if err != nil { fmt.Println(err) diff --git a/main/main_async.go b/main/main_async.go index 7a25668..27c8eb8 100644 --- a/main/main_async.go +++ b/main/main_async.go @@ -23,7 +23,7 @@ func main2() { fmt.Println(err) } for i := 1; i < 100; i++ { - data := []byte("hello xiemalin" + strconv.Itoa(i)) + data := []byte("hello jhunters" + strconv.Itoa(i)) queue.EnqueueAsync(data, func(index int64, err error) { if err != nil { fmt.Println(err) diff --git a/utils.go b/utils.go index 558a1df..b49038d 100644 --- a/utils.go +++ b/utils.go @@ -79,6 +79,7 @@ func Mod(val int64, bits int) int64 { return val - ((val >> uint(bits)) << uint(bits)) } +// get all files from current directory. not include any sub directories func GetFiles(pathname string) (*list.List, error) { files := list.New() @@ -93,6 +94,7 @@ func GetFiles(pathname string) (*list.List, error) { return files, err } +// remove all files from current directory. not include any sub directories func RemoveFiles(pathname string) error { list, err := GetFiles(pathname) if err != nil {