dongxiz5342
2019-07-24 15:42
浏览 1.6k
已采纳

如何使用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?

图片转代码服务由CSDN问答提供 功能建议

我已经使用Go模块(在Go 1.13中获取get)安装了一个软件包,现在我想将其删除。 在文档中,与此无关,在去获取文档都不会。

从go.mod中删除软件包

我应该如何彻底清除软件包?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 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.

    打赏 评论

相关推荐 更多相似问题