Skip to content

Commit 77b7bed

Browse files
Remove passing tasks slice into the Run method
1 parent a378788 commit 77b7bed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎chapter7/patterns/runner/runner.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (r *runner) Start() {
5454

5555
// Run the different tasks on a different goroutine.
5656
go func() {
57-
r.complete <- r.run(r.tasks...)
57+
r.complete <- r.run()
5858
log.Println("Finished work.")
5959
}()
6060

@@ -76,8 +76,8 @@ func (r *runner) Start() {
7676
}
7777

7878
// run executes each registered task.
79-
func (r *runner) run(tasks ...func(int)) error {
80-
for id, task := range tasks {
79+
func (r *runner) run() error {
80+
for id, task := range r.tasks {
8181
// Check for an interrupt signal from the OS.
8282
if r.gotInterrupt() {
8383
return errors.New("Early Shutdown")

0 commit comments

Comments
 (0)