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

Do not return error #1

Closed
fallais opened this issue Jan 14, 2020 · 2 comments · Fixed by #2
Closed

Do not return error #1

fallais opened this issue Jan 14, 2020 · 2 comments · Fixed by #2
Assignees

Comments

@fallais
Copy link

fallais commented Jan 14, 2020

Hello,

I am using your package, great work, thanks a lot. I would like to share an idea to improve your package.

gores.JSON(w, http.StatusOK, nil) returns an error.

The way I use it, like you do it yourself in the documentation, I ignore the error, giving this result when using golangci-lint : Error return value of gores.JSON is not checked (errcheck)

Two choices :

  • Do not return an error and write an error message in the response directly, for example Error while marshalling response.
  • Create two functions, for convenience, for example : JSON and JSONE.

What do you think ?

@fallais
Copy link
Author

fallais commented Mar 6, 2020

@evrimalacan : why downvote ? Could you please explain ?

@fallais
Copy link
Author

fallais commented Mar 6, 2020

@alioygur : did you see this feature request please ?

@aliuygur aliuygur reopened this May 16, 2020
@aliuygur aliuygur self-assigned this May 16, 2020
@aliuygur aliuygur linked a pull request May 16, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants