Removing packages installed with go get

I ran go get package to download a package before learning that I needed to set my GOPATH otherwise that package sullies my root Go install (I would much prefer to keep my Go install clean and separate core from custom). How do I remove packages installed previously?

3 Likes

It’s safe to just delete the source directory and compiled package file. Find the source directory under $GOPATH/src and the package file under $GOPATH/pkg/<architecture> , for example: $GOPATH/pkg/windows_amd64 .

Refer: stackoverflow.com