dongxiz5342 2019-07-24 15:42 采纳率: 100%
浏览 2334
已采纳

如何使用Go模块删除已安装的软件包

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?

  • 写回答

3条回答 默认 最新

  • doufen3838 2019-07-24 15:57
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?