Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple: suggest time.Time.After, time.Time.Before #1595

Open
johanbrandhorst opened this issue Aug 23, 2024 · 0 comments
Open

simple: suggest time.Time.After, time.Time.Before #1595

johanbrandhorst opened this issue Aug 23, 2024 · 0 comments

Comments

@johanbrandhorst
Copy link

Examples:

  1. Suggest rewrite of
    if x.Sub(y) > 0
    to
    if x.After(y)
  2. Suggest rewrite of
    if x.Sub(y) < 0
    to
    if x.Before(y)

Could also suggest !x.After instead of x.Sub(y) <= 0 and vice versa, but it's maybe a little more nuanced.

@johanbrandhorst johanbrandhorst added the needs-triage Newly filed issue that needs triage label Aug 23, 2024
@johanbrandhorst johanbrandhorst changed the title Suggest time.Time.After, time.Time.Before , time.Time.Compare Suggest time.Time.After, time.Time.Before Aug 23, 2024
@dominikh dominikh changed the title Suggest time.Time.After, time.Time.Before simple: suggest time.Time.After, time.Time.Before Aug 23, 2024
@dominikh dominikh added new-check and removed needs-triage Newly filed issue that needs triage labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants