Skip to content

Commit

Permalink
💚 Linter (#11)
Browse files Browse the repository at this point in the history
* 📝 Fix Readme, Linter is not ready for go1.18 :(
  • Loading branch information
kitstack authored Mar 28, 2022
1 parent 2297628 commit 3f9c896
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Go](https://github.com/lab210-dev/async-job/actions/workflows/go.yml/badge.svg)](https://github.com/lab210-dev/async-job/actions/workflows/go.yml)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/lab210-dev/async-job)
[![Go Report Card](https://goreportcard.com/badge/github.com/lab210-dev/async-job)](https://goreportcard.com/report/github.com/lab210-dev/async-job)
[![codecov](https://codecov.io/gh/lab210-dev/async-job/branch/main/graph/badge.svg?token=3JRL5ZLSIH)](https://codecov.io/gh/lab210-dev/async-job)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lab210-dev/async-job/blob/main/LICENSE)
Expand Down Expand Up @@ -71,7 +72,7 @@ func main() {
for i := 1; i <= 100; i++ {
list = append(list, time.Duration(1)*time.Millisecond)
}
err := asyncjob.New().
err := asyncjob.New[time.Duration]().
SetWorkers(2).
OnProgress(func(progress asyncjob.Progress) {
// Eta will be displayed every 10 jobs
Expand All @@ -81,9 +82,9 @@ func main() {
// print the eta
log.Printf("Progress: %s\n", progress.String())
}).
Run(func(job asyncjob.Job) error {
Run(func(job asyncjob.Job[time.Duration]) error {
// slow down the job
time.Sleep(job.Data().(time.Duration))
time.Sleep(job.Data())
return nil
}, list)

Expand Down

0 comments on commit 3f9c896

Please sign in to comment.