1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-27 22:18:41 +02:00
Commit Graph

1 Commits

Author SHA1 Message Date
ccoVeille
3cac850cb6 feature: add rule time-date to check for time.Date usage (#1327)
This commit introduces a new rule to check for the usage of time.Date

The rule is added to report the usage of time.Date with non-decimal literals

Here the leading zeros that seems OK, forces the value to be octal literals.
time.Date(2023, 01, 02, 03, 04, 05, 06, time.UTC)

gofumpt formats the code like this when it encounters leading zeroes.
time.Date(2023, 0o1, 0o2, 0o3, 0o4, 0o5, 0o6, time.UTC)

The rule reports anything that is not a decimal literal.
2025-05-22 21:44:04 +02:00