What is the best way to remove dependency in Golang?
what do you mean with “removing dependency”?
- removing it from your project?
Remove it fromgo.modfile and rungo mod tidy(of course it works only if your code doesn’t use the dependency
1 Like
Yes, from the project. Thanks.
- Run
go mod tidy: Next, run thego mod tidycommand in your terminal. This command will scan your project’sgo.modfile and remove any unused dependencies. If the package you removed wasn’t being used,go mod tidywill automatically remove it from thego.modfile as well.
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.