Uninstalling Packages Installed with go get
When installing packages using go get without setting GOPATH, the packages are installed under the root Go install location. This can lead to a cluttered installation and make it difficult to manage custom and core Go packages separately. To remove such unwanted packages, follow these steps:
To remove a package previously installed with go get, use the following command:
go get package@none
In this command:
For example, to remove the util package installed previously, run:
go get util@none
After running this command, the util package will be removed from the root Go install location. You can verify this by running go list and checking if the package is listed.
The above is the detailed content of How Do I Uninstall Packages Installed with `go get`?. For more information, please follow other related articles on the PHP Chinese website!