Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Do not return error #1

@fallais

Description

@fallais

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 ?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions