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

all: using the more elegant way to deal milliseconds and nanoseconds #292

Merged
merged 1 commit into from Mar 16, 2023

Conversation

cuishuang
Copy link
Contributor

Go 1.17 added support for milliseconds and microseconds, using them can make the code more concise and readable

Signed-off-by: cui fliter <imcusg@gmail.com>
@ludoch ludoch requested a review from zevdg March 15, 2023 22:14
@zevdg zevdg requested review from jinglundong and removed request for zevdg March 15, 2023 22:22
Copy link
Collaborator

@jinglundong jinglundong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. A couple factors that I thought about:

  1. The precision should be fine. Before and after this change should have the same precision.
  2. Microseconds and milliseconds are converted correctly (1e6 vs. 1e3).

@jinglundong
Copy link
Collaborator

@cuishuang I'm not too sure about this, but I believe you need to follow Learn more about signing commits. and sign this commit.

@ludoch ludoch merged commit 9d6c353 into golang:master Mar 16, 2023
ludoch added a commit that referenced this pull request Mar 16, 2023
ludoch added a commit that referenced this pull request Mar 16, 2023
@Deleplace
Copy link
Contributor

Deleplace commented Mar 20, 2023

As time.Time.UnixMicro (et al.) were added in Go 1.17, the tests are failing for Go 1.11-1.16.

Which explains the revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants