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

support scan assign slice cap #5634

Merged
merged 2 commits into from Sep 22, 2022
Merged

Conversation

demoManito
Copy link
Member

@demoManito demoManito commented Aug 23, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

support scan assign slice cap,instead of the default cap of 20

User Case Description

for example:

users := make([]User, 0, 2)
db.Where(...).Find(&users).Error

The initial make cap is 2, instead of 20. And there is no need to reallocate.

@jinzhu jinzhu merged commit 1f634c3 into go-gorm:master Sep 22, 2022
jinzhu pushed a commit that referenced this pull request Sep 22, 2022
* support scan assign slice cap

* fix
@demoManito demoManito deleted the feature/support-cap branch February 21, 2024 06:24
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.

None yet

2 participants