tomarrell / wrapcheck

A Go linter to check that errors from external packages are wrapped
https://blog.tomarrell.com/post/introducing_wrapcheck_linter_for_go
MIT License
291 stars 26 forks source link

HTTP Handlers Errors #33

Closed 1995parham closed 1 year ago

1995parham commented 2 years ago

Most of the go http frameworks has the error as return in their handlers, so we can add them into the ignore pattern if you agree.

tomarrell commented 1 year ago

G'day @1995parham, would you be able to describe better the issue you're having? Currently your request is a little vague.

1995parham commented 1 year ago

Sure, for example on gofiber we have:

    app.Get("/", func(c *fiber.Ctx) error {
        return c.SendString("Hello, World 👋!")
    })

I think, it doesn't a good idea to wrap its error.

tomarrell commented 1 year ago

You should already be able to have wrapcheck refrain from reporting errors like this using the configuration parameters. Is that not working for you?

1995parham commented 1 year ago

Yes, exactly we are using that configuration. The only issue is about for us to repeat the default values too. So if we can somehow add these into the defaults or append the configuration to them it would be great.

tomarrell commented 1 year ago

I'm sorry, I don't think it makes sense to add these to the default configuration, as this practice wouldn't be scalable for all the libraries out there.

Yes, you need to add the defaults yourself if you are going to configure it. This enables people to easily override the default set.