我已经使用Go模块安装了一个软件包(Go in Go 1.13),现在我想要删除它.在documentation米里没有这方面的东西,在go get docu米里也没有.
手动从go.mod中删除软件包并不能解决问题,因此它仍保留在go.sum中.
我应该如何干净地移除包裹?
我已经使用Go模块安装了一个软件包(Go in Go 1.13),现在我想要删除它.在documentation米里没有这方面的东西,在go get docu米里也没有.
手动从go.mod中删除软件包并不能解决问题,因此它仍保留在go.sum中.
我应该如何干净地移除包裹?
我发现它是https://blog.golang.org/using-go-modules#TOC_7.
go mod tidy
个
So basically, once the package is not being imported in any package you can perform a go mod tidy
个 and it will safely remove the unused dependencies.
如果您要提供依赖项,请运行以下命令以使模块更改在供应商文件夹中应用:
go mod vendor
个