-
Notifications
You must be signed in to change notification settings - Fork 163
Use time.Duration as type for timeouts #235
Conversation
@pdalpra cool 👍 Using |
should I introduce this as a utility function or inline the code for the time being ? |
@pdalpra maybe a utility function it |
sorry for keeping it stale, will update the PR today |
Signed-off-by: Pierre Dal-Pra <[email protected]>
Signed-off-by: Pierre Dal-Pra <[email protected]>
@vdemeester PR (finally !) updated |
LGTM 👼 |
I can take of the matching PR on |
LGTM |
I'm a bit late to the review. First, great thought and contribution @pdalpra. It is much appreciated and I think it is good practice to use I do not like that we convert an int to a float then parse the float to convert to a string.
My suggestion would to be add a comment on the rounding, just so no-one expects to get sub second precision, or to adopt what is in the godocs for Thanks again @pdalpra for the contribution here and in moby/moby#23344! |
This PR replaces instances of where timeout was an
int
representing the number of seconds bytime.Duration
, as suggested by #230 .Not entirely sure about the float64 -> int conversion, also thought about using
strconv.FormatFloat(v, 'f', 0, 64)
for formatting it as an integer. WDYT ?