Removing packages installed with go get

go
Nucleon picture Nucleon · Dec 9, 2012 · Viewed 150.6k times · Source

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?

Answer

Sonia picture Sonia · Dec 9, 2012

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.