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

It doesn't work for "if with a statement" #139

Open
y7ls8i opened this issue Jul 25, 2024 · 1 comment
Open

It doesn't work for "if with a statement" #139

y7ls8i opened this issue Jul 25, 2024 · 1 comment

Comments

@y7ls8i
Copy link

y7ls8i commented Jul 25, 2024

if err := veryLongFunctionWithManyLongArguments(veryLongArgument1, veryLongArgument2, veryLongArgument3, veryLongArgument4, veryLongArgument5); err != nil {
	// ... ... ...
}

should have been broken down into:

if err := veryLongFunctionWithManyLongArguments(
	veryLongArgument1,
	veryLongArgument2,
	veryLongArgument3,
	veryLongArgument4,
	veryLongArgument5,
); err != nil {
	// ... ... ...
}

but it doesn't.

@y7ls8i y7ls8i changed the title It doesn't work for "if with a short statement" It doesn't work for "if with a statement" Jul 25, 2024
@shuaiyy
Copy link

shuaiyy commented Aug 12, 2024

the same case

if err = n.db.Unscoped().Model(&models.User{}).Where("id = ?", id).First(&item).Error; err == nil {
}

but below is worked:

err = n.db.Unscoped().Model(&models.NotebookEnv{}).Where("id = ?", id).First(&item).Error
if err == nil {
}

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

2 participants