Skip to content

Commit a13f58f

Browse files
committed
docs: update example
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 506077f commit a13f58f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ First to create new job as `QueueMessage` interface:
2323

2424
```go
2525
type job struct {
26-
message string
26+
Message string
2727
}
2828

2929
func (j *job) Bytes() []byte {
30-
return []byte(j.message)
30+
return []byte(j.Message)
3131
}
3232
```
3333

@@ -94,7 +94,7 @@ Third to create queue and initialize multiple worker, receive all job message:
9494
for i := 0; i < taskN; i++ {
9595
go func(i int) {
9696
q.Queue(&job{
97-
message: fmt.Sprintf("handle the job: %d", i+1),
97+
Message: fmt.Sprintf("handle the job: %d", i+1),
9898
})
9999
}(i)
100100
}
@@ -109,7 +109,7 @@ Third to create queue and initialize multiple worker, receive all job message:
109109
q.Wait()
110110
```
111111

112-
Full example code as below or [try it in playground](https://play.golang.org/p/xuR4WhcFdoQ).
112+
Full example code as below or [try it in playground](https://play.golang.org/p/ZM3XAnYcAs7).
113113

114114
```go
115115
package main

0 commit comments

Comments
 (0)