Browse Source

Rename function

Vova Tkach 5 years ago
parent
commit
a73c97986d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      worker/worker.go

+ 2 - 2
worker/worker.go

@@ -16,10 +16,10 @@ type Callback func(ctx context.Context, w *Worker)
 func New(f Callback) *Worker {
 	ctx, cancel := context.WithCancel(context.Background())
 	w := Worker{ctx: ctx, cancel: cancel, chDone: make(chan bool)}
-	return (&w).doit(f)
+	return (&w).loop(f)
 }
 
-func (this *Worker) doit(f func(ctx context.Context, w *Worker)) *Worker {
+func (this *Worker) loop(f func(ctx context.Context, w *Worker)) *Worker {
 	go func() {
 		for {
 			select {