How to remove an installed package using go modules

陌路散爱 提交于 2019-12-08 00:33:01

问题


I've installed a package using go modules (go get in Go 1.13) and now I want to remove it. In the documentation there is nothing about this and in go get docu neither.

Removing the package from go.mod manually doesn't solve the issue so it remains in go.sum.

How should I remove a package in a clean why?


回答1:


Found it 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 depencies.



来源:https://stackoverflow.com/questions/57186705/how-to-remove-an-installed-package-using-go-modules

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!