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

proposal: builtin: Go 2 - len returns uint64 #28060

Closed
pjebs opened this issue Oct 6, 2018 · 2 comments
Closed

proposal: builtin: Go 2 - len returns uint64 #28060

pjebs opened this issue Oct 6, 2018 · 2 comments

Comments

@pjebs
Copy link
Contributor

@pjebs pjebs commented Oct 6, 2018

Currently:

func len(v Type) int

int is a signed integer type that is at least 32 bits in size. It is a distinct type, however, and not an alias for, say, int32.

Is there a reason why len returns an int instead of an uint?

Is there a reason why it doesn't return an uint64?

@gopherbot gopherbot added this to the Proposal milestone Oct 6, 2018
@pjebs
Copy link
Contributor Author

@pjebs pjebs commented Oct 6, 2018

In database/sql it could have been done the same way but instead it's an int64 (which is better than an int)

// LastInsertId returns the integer generated by the database
// in response to a command. Typically this will be from an
// "auto increment" column when inserting a new row. Not all
 // databases support this feature, and the syntax of such
// statements varies.
 LastInsertId() (int64, error)

 RowsAffected() (int64, error)

@dominikh
Copy link
Member

@dominikh dominikh commented Oct 7, 2018

Closing as duplicate of #27460

@dominikh dominikh closed this Oct 7, 2018
@golang golang locked and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants