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

time: Add after or equal and before or equal #49255

Closed
sashamelentyev opened this issue Nov 1, 2021 · 2 comments
Closed

time: Add after or equal and before or equal #49255

sashamelentyev opened this issue Nov 1, 2021 · 2 comments

Comments

@sashamelentyev
Copy link
Contributor

sashamelentyev commented Nov 1, 2021

Need AfterOrEqual and BeforeOrEqual methods in time package

If you need check t after or equal you code this

if time.After(u) || time.Equal(u) {
    // ...
}

With needed methods

if time.AfterOrEqual(u) {
    // ...
}

Code look cleaner

#49252

@moredure
Copy link
Contributor

moredure commented Nov 1, 2021

you can just use !t.Before(u) for same purpose

@sashamelentyev
Copy link
Contributor Author

@moredure thank you!

@golang golang locked and limited conversation to collaborators Nov 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants