Skip to content

Commit

Permalink
fix example test
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Oct 30, 2023
1 parent ab0081d commit 664cf78
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gocron_test

import (
"context"
"fmt"
"sync"
"time"
Expand Down Expand Up @@ -389,20 +388,20 @@ func ExampleWithClock() {
// one, 2
}

var _ Elector = (*myElector)(nil)

type myElector struct{}

func (m myElector) IsLeader(_ context.Context) error {
return nil
}

func ExampleWithDistributedElector() {
elector := myElector{}

_, _ = NewScheduler(
WithDistributedElector(elector),
)
//var _ Elector = (*myElector)(nil)
//
//type myElector struct{}
//
//func (m myElector) IsLeader(_ context.Context) error {
// return nil
//}
//
//elector := myElector{}
//
//_, _ = NewScheduler(
// WithDistributedElector(elector),
//)
}

func ExampleWithEventListeners() {
Expand Down

0 comments on commit 664cf78

Please sign in to comment.