- 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