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

[proposal] save the return line #3116

Open
mozhata opened this issue Apr 11, 2022 · 1 comment
Open

[proposal] save the return line #3116

mozhata opened this issue Apr 11, 2022 · 1 comment

Comments

@mozhata
Copy link

mozhata commented Apr 11, 2022

Description

gin should do something to save the return line

How to reproduce

when met an error we use to lines to deal with it

	var err error 
	if err != nil{
		c.Status(http.StatusInternalServerError)
		return
	}

It will be cool to use return c.Status(http.StatusInternalServerError) or provide some alike method to support this

@mozhata mozhata changed the title save the retun line save the return line Apr 11, 2022
@mozhata mozhata changed the title save the return line #proposal save the return line Apr 11, 2022
@mozhata mozhata changed the title #proposal save the return line [proposal] save the return line Apr 11, 2022
arshabbir added a commit to arshabbir/gin that referenced this issue May 5, 2022
@arshabbir
Copy link

arshabbir commented May 5, 2022

@easonlin404

Please review

#3140

Added error return for c.Status(code) so that this can be used as return c.Status(code) to avoid/save extra return statement

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