Get a list of all installed packages in Go

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:26:32

问题


How can I list all installed packages via goinstall? I need this to reinstall all packages installed on one computer to a different computer.


回答1:


There is a list under $GOROOT/goinstall.log If you want to install all the packages on an different computer just copy the file across and run,

goinstall -a

and goinstall will read this file and install all packages listed in it.




回答2:


Most answers here are for pre-Go 1.0 which is several years old and the answers are no longer applicible to working Go installations.

The simple answer is go list ... (as with other go sub-commands three literal periods match all packages). That will list every package on the system. See go list -h for other uses of this veristile command.

Dave Cheney also has a related blog article: go list, your Swiss army knife.




回答3:


I'm not sure there's a way to do it through goinstall, but there should be a list under $GOROOT/goinstall.log.



来源:https://stackoverflow.com/questions/6590054/get-a-list-of-all-installed-packages-in-go

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