Skip to content

Commit 0f247ce

Browse files
fix: address G115 linter errors in parser.go
1 parent 058a7d4 commit 0f247ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

parser.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ func (e Expression) Next(from time.Time) time.Time {
198198
}
199199

200200
// 1. Month
201-
if (1<<int(t.Month()))&e.month == 0 {
201+
// #nosec G115
202+
if (1<<uint(t.Month()))&e.month == 0 {
202203
// Find next valid month
203204
nextMonth, ok := findNextBit(e.month, int(t.Month())+1, 1, 12)
204205
if !ok {
@@ -212,7 +213,9 @@ func (e Expression) Next(from time.Time) time.Time {
212213
}
213214

214215
// 2. Day (DOM/DOW)
216+
// #nosec G115
215217
domMatch := (1<<uint(t.Day()))&e.dom != 0
218+
// #nosec G115
216219
dowMatch := (1<<uint(t.Weekday()))&e.dow != 0
217220

218221
dayMatched := false
@@ -234,6 +237,7 @@ func (e Expression) Next(from time.Time) time.Time {
234237
}
235238

236239
// 3. Hour
240+
// #nosec G115
237241
if (1<<uint(t.Hour()))&e.hour == 0 {
238242
nextHour, ok := findNextBit(e.hour, t.Hour()+1, 0, 23)
239243
if ok {
@@ -246,6 +250,7 @@ func (e Expression) Next(from time.Time) time.Time {
246250
}
247251

248252
// 4. Minute
253+
// #nosec G115
249254
if (1<<uint(t.Minute()))&e.minute == 0 {
250255
nextMinute, ok := findNextBit(e.minute, t.Minute()+1, 0, 59)
251256
if ok {
@@ -258,6 +263,7 @@ func (e Expression) Next(from time.Time) time.Time {
258263
}
259264

260265
// 5. Second
266+
// #nosec G115
261267
if (1<<uint(t.Second()))&e.second == 0 {
262268
nextSecond, ok := findNextBit(e.second, t.Second()+1, 0, 59)
263269
if ok {

0 commit comments

Comments
 (0)