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

Ambiguity in time.Duration manipulation #34787

Closed
mcandre opened this issue Oct 9, 2019 · 2 comments
Closed

Ambiguity in time.Duration manipulation #34787

mcandre opened this issue Oct 9, 2019 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@mcandre
Copy link

mcandre commented Oct 9, 2019

time.Duration currently requires non-constant, non-literal multiplication with factors, such as hours x 3, minutes x 10, to be performed with explicit casting of the factor with time.Duration(factor). However, this casting can result in surprising duration products, when the programmer forgets to include the unit multiplier.

Should we therefore allow implicit casting of non-duration factors, as well as deprecate casting real values without units to durations?

@mvdan
Copy link
Member

mvdan commented Oct 9, 2019

What exactly are you proposing? A change to the language, a change to the time package, or something else? Please clarify with examples.

@mvdan mvdan added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 9, 2019
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Nov 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants