-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Use db.Find instead of writing methods for every object #28084
Conversation
Why sometimes |
All db.Find and db.FindAndCount has been using pointer to struct but for db.Count, if we use a pointer, we need introduce reflect so I don't think it's necessary. So all db.Count should use struct directly. |
How to avoid low-level mistakes? When reviewing PRs, which is right while which is wrong?
I do not think leaving low-level mistakes in a framework is healthy to a big project. |
[x] db.Find[T] Let me try to avoid |
Why not just use |
@lunny please fix the merge conflicts. 🍵 |
* giteaofficial/main: Use db.Find instead of writing methods for every object (go-gitea#28084) Edit Discord Badge (go-gitea#28188) Use restricted sanitizer for repository description (go-gitea#28141) Use full width for PR comparison (go-gitea#28182) Make CORS work for oauth2 handlers (go-gitea#28184) Fix missing buttons (go-gitea#28179)
For those simple objects, it's unnecessary to write the find and count methods again and again.
For those simple objects, it's unnecessary to write the find and count methods again and again.
For those simple objects, it's unnecessary to write the find and count methods again and again.