Antonboom / testifylint

The Golang linter that checks usage of github.com/stretchr/testify.
https://github.com/stretchr/testify
MIT License
87 stars 8 forks source link

time-compare: protect from `Equal(t, time1, time2)` #60

Open Antonboom opened 5 months ago

Antonboom commented 5 months ago

https://github.com/stretchr/testify/issues/1510#issuecomment-1915502355

with configurable fix:

equal-time:
  fix: WithinDuration # or Truncate
Antonboom commented 4 weeks ago

Related: https://github.com/kubernetes/kubernetes/blob/e67f889edc4ab278028f6cffd2501bc90a0defcf/pkg/controller/podautoscaler/metrics/client_test.go#L233

Antonboom commented 4 weeks ago

one more case to time-compare from https://github.com/Antonboom/testifylint/issues/75

assert.True(t, ts.IsZero()) -> assert.Zero(t, ts)