Skip to content

return uint64 for parseSize#19

Closed
allencloud wants to merge 1 commit intodocker:masterfrom
allencloud:return-uint64-for-parseSize
Closed

return uint64 for parseSize#19
allencloud wants to merge 1 commit intodocker:masterfrom
allencloud:return-uint64-for-parseSize

Conversation

@allencloud
Copy link
Contributor

As parseSize already returns error, so I think there is no need to return -1.
Then we can change returned type from int64 to uint64.

Signed-off-by: allencloud allen.sun@daocloud.io

@allencloud allencloud force-pushed the return-uint64-for-parseSize branch from 5c3ff84 to 4475901 Compare August 12, 2016 02:25
Signed-off-by: allencloud <allen.sun@daocloud.io>
@allencloud allencloud force-pushed the return-uint64-for-parseSize branch from 4475901 to 8d2efbf Compare August 12, 2016 02:59
@allencloud
Copy link
Contributor Author

Any update?

@dnephin
Copy link
Contributor

dnephin commented Aug 25, 2016

Seems ok to me, but this change is far from backwards compatible.

Is it worth breaking everyone who is using this library?

@allencloud
Copy link
Contributor Author

What you said is reasonable. @dnephin Thanks for your feedback.

Actually, I did this PR for two reasons:

  1. -1 is somewhat redundant in this case, as we already have an error, right?
  2. Here is some kind of demand in docker engine : https://github.com/docker/docker/blob/master/runconfig/opts/parse.go#L325

While, to be honest, backwards compatibility is something I missed, sorry for that. :)

@thaJeztah
Copy link
Member

Should we close this PR?

@dnephin
Copy link
Contributor

dnephin commented Sep 26, 2016

If we can't make it backwards compatible I think we should close it. I understand it is more correct, but I'm not sure we gain enough from it to warrant the breaking change.

@allencloud
Copy link
Contributor Author

Yes. What you said is totally reasonable. Thanks a lot for your review. @dnephin @thaJeztah I am closing it.

@allencloud allencloud closed this Sep 27, 2016
@thaJeztah
Copy link
Member

Thanks @allencloud

thaJeztah added a commit to thaJeztah/containerd that referenced this pull request Apr 23, 2019
relevant changes:

- docker/go-units#19 make 1 second not to be plural seconds
- docker/go-units#20 Add `HumanSizeWithPrecision` function
- docker/go-units#21 change week display rule
- docker/go-units#22 Better human duration precision
- docker/go-units#23 Removes spaces before unit
- docker/go-units#27 Fix containerd#26 - RAMInBytes Bug
- docker/go-units#33 Fix handling of unlimited (-1) ulimit values
- docker/go-units#34 Revert 46 minute threshold

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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.

3 participants