diff --git a/_examples/task.go b/_examples/task.go index c9c27b0..db814ad 100644 --- a/_examples/task.go +++ b/_examples/task.go @@ -54,10 +54,5 @@ func main() { // Duration is the duration between two loop of fn, optional. // Run will start a new goroutine and run the task loop. // The task will stop if context is done. - task.New(printContextValue). - Before(beforePrint). - After(afterPrint). - Context(ctx). - Duration(time.Second). - Run() + task.New(printContextValue).Before(beforePrint).After(afterPrint).Context(ctx).Duration(time.Second).Run() } diff --git a/doc.go b/doc.go index 819a092..a9334bc 100644 --- a/doc.go +++ b/doc.go @@ -437,12 +437,7 @@ Package cachego provides an easy way to use foundation for your caching operatio // Duration is the duration between two loop of fn, optional. // Run will start a new goroutine and run the task loop. // The task will stop if context is done. - task.New(printContextValue). - Before(beforePrint). - After(afterPrint). - Context(ctx). - Duration(time.Second). - Run() + task.New(printContextValue).Before(beforePrint).After(afterPrint).Context(ctx).Duration(time.Second).Run() 10. clock: