Skip to content

Commit

Permalink
lint: golangci: remove unnecessary conversion (unconvert)
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Dec 9, 2023
1 parent 75aa86a commit 1f0911f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions time/timeutil/quarter_int.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func QuarterInt32StartTime(yyyyq int32) (time.Time, error) {
return time.Now(), err
}
qm := QuarterToMonth(Yearquarter(q))
return time.Date(int(yyyy), time.Month(qm), 1, 0, 0, 0, 0, time.UTC), nil
return time.Date(int(yyyy), qm, 1, 0, 0, 0, 0, time.UTC), nil
}

func QuarterInt32EndTime(yyyyq int32) (time.Time, error) {
Expand Down Expand Up @@ -166,7 +166,7 @@ func QuarterInt32End(yyyyq int32) (time.Time, error) {
q += 1
}
qm := QuarterToMonth(Yearquarter(q))
return time.Date(int(yyyy), time.Month(qm), 0, 23, 59, 59, 0, time.UTC), nil
return time.Date(int(yyyy), qm, 0, 23, 59, 59, 0, time.UTC), nil
}

func ParseHalf(yyyyh int32) (int32, uint8, error) {
Expand Down
2 changes: 1 addition & 1 deletion time/timeutil/start_end.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func monthStart(dt time.Time) time.Time {
// quarterStart returns a time.Time for the start of the quarter.
func quarterStart(t time.Time) time.Time {
qm := QuarterToMonth(MonthToQuarter(t.Month()))
return time.Date(t.Year(), time.Month(qm), 1, 0, 0, 0, 0, t.Location())
return time.Date(t.Year(), qm, 1, 0, 0, 0, 0, t.Location())
}

func yearStart(t time.Time) time.Time {
Expand Down

0 comments on commit 1f0911f

Please sign in to comment.