Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemalin committed Jun 30, 2020
1 parent 4f93c6e commit c933c7d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion main/main_async.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 {
Expand Down

0 comments on commit c933c7d

Please # to comment.