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

Represent sizes as int64 instead of uint64 #67

Closed
ammario opened this issue Jan 22, 2018 · 4 comments
Closed

Represent sizes as int64 instead of uint64 #67

ammario opened this issue Jan 22, 2018 · 4 comments

Comments

@ammario
Copy link

ammario commented Jan 22, 2018

I think this package should accept and return sizes typed int64 instead of uint64.

The standard library uses int64 to represent sizes, so I do a lot of casting when using this package.

Thanks.

@ammario ammario changed the title Accept int64 instead of uint64 Represent sizes as int64 instead of uint64 Jan 22, 2018
@dustin
Copy link
Owner

dustin commented Apr 21, 2018

I understand the inconvenience, but that's a fairly large backwards incompatible change. Conceptually, the number of bytes in something is non-negative, so unsigned made sense at the time. Having to convert from int64 or int or float64 or whatever in order to format a number is an unfortunate language constraint, but it's not a logical flaw in the concept of representing bytes as non-negative numbers.

@dustin dustin closed this as completed Apr 21, 2018
@ammario
Copy link
Author

ammario commented Oct 5, 2018

The breakage would be trivial to fix, and the orthogonality with the rest of the Go ecosystem would make this API significantly better. I can carry out the change, as well, if you reconsider this.

@nhooyr
Copy link

nhooyr commented Oct 5, 2018

And with Go modules it doesn't have to be backwards incompatible.

@yvele
Copy link

yvele commented Jul 6, 2020

Can this issue be reconsidered?

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

No branches or pull requests

4 participants