chore: update golangci-lint config

This commit is contained in:
Steven
2023-09-17 22:55:13 +08:00
parent 9eb077c4af
commit cd0ea6558d
72 changed files with 272 additions and 187 deletions

View File

@@ -1,18 +1,17 @@
// Package cron implements a crontab-like service to execute and schedule
// repeative tasks/jobs.
//
// Package cron implements a crontab-like service to execute and schedule repeative tasks/jobs.
package cron
// Example:
//
// c := cron.New()
// c.MustAdd("dailyReport", "0 0 * * *", func() { ... })
// c.Start()
package cron
import (
"errors"
"fmt"
"sync"
"time"
"github.com/pkg/errors"
)
type job struct {
@@ -90,7 +89,7 @@ func (c *Cron) Add(jobID string, cronExpr string, run func()) error {
schedule, err := NewSchedule(cronExpr)
if err != nil {
return fmt.Errorf("failed to add new cron job: %w", err)
return errors.Wrap(err, "failed to add new cron job")
}
c.jobs[jobID] = &job{