Golang Tutorial

Golang Reference

Golang Programs

Golang Practice

Golang Miscellaneous

How to remove packages installed with go get command?

Learn to remove packages installed with the go get command.
Submitted by IncludeHelp, on November 23, 2021

When we install the packages using the go get command the source directory is saved under the $GOPATH/src and the package file is saved under the $GOPATH/pkg/<architecture> (For 64-bit Windows, $GOPATH/pkg/windows_amd64).

If you want to remove the packages installed with the go get command – we can directly delete the files/directories related to the installed package. We have to delete the source directory under $GOPATH/src and compiled package file under $GOPATH/pkg/<architecture>.

Another way – Removing using the go clean - i command

go clean -i importpath...

This command deletes the archive files and executable binaries but the source directory we have to remove manually under $GOPATH/src.

Golang FAQ »

Comments and Discussions!

Load comments ↻

Copyright © 2024 www.includehelp.com. All rights reserved.