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

request: update generated code to return nil instead of a nil value #991

Open
marcelloh opened this issue Nov 6, 2024 · 1 comment
Open
Labels
enhancement New feature or request generator good first issue Good for newcomers

Comments

@marcelloh
Copy link

Describe the bug
It's not really a bug, but more of a "thing to do, when coding in Go"

In the generated code, there is a lot of:

		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		return templ_7745c5c3_Err

but it is more idiomatic to return just nil, like this:

		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		return nil
@a-h
Copy link
Owner

a-h commented Nov 6, 2024

I'd take a PR for that.

@a-h a-h changed the title Return nil instead of nil value proposal: generated could could return nil instead of a nil value Nov 20, 2024
@a-h a-h added enhancement New feature or request good first issue Good for newcomers generator labels Nov 20, 2024
@a-h a-h changed the title proposal: generated could could return nil instead of a nil value request: update generated code to return nil instead of a nil value Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request generator good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants