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.mod
file 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 tidy
command in your terminal. This command will scan your project’sgo.mod
file and remove any unused dependencies. If the package you removed wasn’t being used,go mod tidy
will automatically remove it from thego.mod
file as well.
1 Like
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.