Skip to content

Commit

Permalink
upgrade to golangci lint 1.53.1 (go-co-op#506)
Browse files Browse the repository at this point in the history
* upgrade to golangci lint 1.53

* 1.53.0 -> 1.53.1

* address lint findings
  • Loading branch information
JohnRoesler authored Jun 2, 2023
1 parent 2bb9ae5 commit 2c3b43d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
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

0 comments on commit 2c3b43d

Please sign in to comment.