chore: update golangci-lint config

This commit is contained in:
steven
2023-09-22 17:55:26 +08:00
committed by Steven
parent a58ebd27ca
commit 07e0bb2d4c
42 changed files with 195 additions and 137 deletions

View File

@@ -1,3 +1,5 @@
package cron
// Package cron implements a crontab-like service to execute and schedule
// repeative tasks/jobs.
//
@@ -6,13 +8,12 @@
// 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 +91,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{