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

Find a solution to reduce dependency leak #82

Open
novln opened this issue Mar 23, 2020 · 2 comments
Open

Find a solution to reduce dependency leak #82

novln opened this issue Mar 23, 2020 · 2 comments

Comments

@novln
Copy link
Contributor

novln commented Mar 23, 2020

Currently, while using github.com/ulule/limiter it doesn't download gin, redis or even fasthttp if you doesn't use it.

It bothers me that these libraries are exported to the go.sum of a project, even though it's not included in it's go.mod.

Maybe there is a solution to reduce this annoyance. I don't know 🤷‍♂️

@novln novln changed the title Find a solution to reduce deme d Find a solution to reduce dependecy leak Mar 23, 2020
@novln novln changed the title Find a solution to reduce dependecy leak Find a solution to reduce dependency leak Mar 23, 2020
@edouardparis
Copy link

I do not understand, they are all three in the go.mod https://github.com/ulule/limiter/blob/master/go.mod#L6

@novln
Copy link
Contributor Author

novln commented Mar 24, 2020

Let's say you have a project named foobar, this one uses redis and chi (for example).

The foobar project will not import the limiter middleware gin or fasthttp. And as such, it will not declare github.com/gin-gonic/gin and github.com/valyala/fasthttp in its (foobar project) go.mod nor download it, which is a good thing.

However, the foobar project will have a declaration of github.com/gin-gonic/gin and github.com/valyala/fasthttp in its go.sum. Which in a sense, is a "dependency leak", because you "import" something you don't use.

I know it's a minor problem, but I would like as much as possible to not "force" dependency to limiter users if they don't use gin or fasthttp for example.

I hope I was more precise and clear with this explanation 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants