Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to golangci lint 1.53.1 #506

Merged
merged 3 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.51.2
version: v1.53.1
- name: Install Go
uses: actions/setup-go@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,8 @@ func (s *Scheduler) Months(daysOfTheMonth ...int) *Scheduler {
if _, ok := repeatMap[dayOfMonth]; ok {
job.error = wrapOrError(job.error, ErrInvalidDaysOfMonthDuplicateValue)
break
} else {
repeatMap[dayOfMonth]++
}
repeatMap[dayOfMonth]++
}
}
if job.daysOfTheMonth == nil {
Expand Down
10 changes: 6 additions & 4 deletions scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func (f fakeTime) Now(loc *time.Location) time.Time {
return f.onNow(loc)
}

func (f fakeTime) Unix(i int64, i2 int64) time.Time {
panic("implement me")
func (f fakeTime) Unix(sec int64, nsec int64) time.Time {
return time.Unix(sec, nsec)
}

func (f fakeTime) Sleep(d time.Duration) {
Expand Down Expand Up @@ -148,7 +148,8 @@ func TestScheduler_Every(t *testing.T) {
}
}
s.Stop()
assert.Equal(t, 2, counter)
assert.GreaterOrEqual(t, counter, 2)
assert.LessOrEqual(t, counter, 3)
})

t.Run("string duration", func(t *testing.T) {
Expand Down Expand Up @@ -2355,7 +2356,8 @@ func TestScheduler_CheckCalculateDaysOfMonth(t *testing.T) {

func TestScheduler_CheckSetBehaviourBeforeJobCreated(t *testing.T) {
s := NewScheduler(time.UTC)
s.Month(1, 2).Every(1).Do(func() {})
_, err := s.Month(1, 2).Every(1).Do(func() {})
assert.NoError(t, err)
}

func TestScheduler_MonthLastDayAtTime(t *testing.T) {
Expand Down