File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ First to create new job as `QueueMessage` interface:
23
23
24
24
``` go
25
25
type job struct {
26
- message string
26
+ Message string
27
27
}
28
28
29
29
func (j *job ) Bytes () []byte {
30
- return []byte (j.message )
30
+ return []byte (j.Message )
31
31
}
32
32
```
33
33
@@ -94,7 +94,7 @@ Third to create queue and initialize multiple worker, receive all job message:
94
94
for i := 0 ; i < taskN; i++ {
95
95
go func (i int ) {
96
96
q.Queue (&job{
97
- message : fmt.Sprintf (" handle the job: %d " , i+1 ),
97
+ Message : fmt.Sprintf (" handle the job: %d " , i+1 ),
98
98
})
99
99
}(i)
100
100
}
@@ -109,7 +109,7 @@ Third to create queue and initialize multiple worker, receive all job message:
109
109
q.Wait ()
110
110
```
111
111
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 ) .
113
113
114
114
``` go
115
115
package main
You can’t perform that action at this time.
0 commit comments