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

interface{} nullity checks are wrong throughout the project #3591

Closed
AdallomRoy opened this issue Oct 11, 2020 · 2 comments
Closed

interface{} nullity checks are wrong throughout the project #3591

AdallomRoy opened this issue Oct 11, 2020 · 2 comments
Assignees
Labels

Comments

@AdallomRoy
Copy link

GORM Playground Link

go-gorm/playground#1

Description

See - https://medium.com/@mangatmodi/go-check-nil-interface-the-right-way-d142776edef1
Throughout the code, example:

if stmt.Model == nil {

This causes many bugs, where the check is skipped.

@github-actions github-actions bot added the type:missing reproduction steps missing reproduction steps label Oct 11, 2020
@github-actions
Copy link

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 2 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.ioSearch Before Asking

@jinzhu
Copy link
Member

jinzhu commented Oct 12, 2020

GORM doesn't expect to accept those arguments and check them by slowing down normal usage, so better check it before use those value as arguments.

@jinzhu jinzhu closed this as completed Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants