最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】go语言中去卸载(之前已安装的)某个包(库)

GO crifan 12515浏览 0评论

【背景】

折腾:

【未解决】go语言中用log4go输出信息时有bug:只输出部分信息

期间,需要先去卸载掉之前已经安装的log4go:

【记录】go语言中安装第三方包package(库):log4go

然后再重新安装。

【折腾过程】

1.看了看,go的命令中,没有uninstall之类的命令。

2.参考:

Go packages

中的解释:

To uninstall, just delete the folder with the library’s import path from GOPATH/src and GOPATH/lib.

直接去手动删除:

E:\Dev_Root\go\src\code.google.com\p\log4go

下面的所有的东西。

以及:

E:\Dev_Root\go\pkg\windows_amd64\code.google.com\p

下面的

log4go.a

3.然后确保的确已经删除了,代码中就找不到了:

E:\Dev_Root\go\src\EmulateLoginBaidu>go run EmulateLoginBaidu.go
EmulateLoginBaidu.go:36:8: cannot find package "code.google.com/p/log4go" in any of:
        E:\dev_install_root\Go\src\pkg\code.google.com\p\log4go (from $GOROOT)
        E:\Dev_Root\go\src\code.google.com\p\log4go (from $GOPATH)

然后再去重新安装:

E:\Dev_Root\go\src\EmulateLoginBaidu>go get code.google.com/p/log4go

E:\Dev_Root\go\src\EmulateLoginBaidu>

4.至此,即可。

 

【总结】

go语言中,卸载某个(之前已经安装过的)库或包时:

直接手动删除对应的src和bin下面的文件(夹)

即可。

转载请注明:在路上 » 【记录】go语言中去卸载(之前已安装的)某个包(库)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.156 seconds, using 22.00MB memory