How to properly remove packages installed via go get in Go?
Hi everyone! I just started learning Go and ran into a problem. I installed several packages using `go get`, but now I want to remove them since I no longer need them. For example, I installed the `github.com/gin-gonic/gin` package for web development, but then switched to another framework. I tried simply deleting the folder from `$GOPATH/src`, but that seems wrong, and I'm not sure it fully cleans the system. I also heard that in newer versions of Go (1.16+), modules were introduced and `go get` works differently. My code:
```go
// go.mod file
module myapp
go 1.18
require github.com/gin-gonic/gin v1.7.7
```
I ran `go get github.com/gin-gonic/gin` and now I want to completely get rid of this package, including its dependencies and compiled files. How can I do this properly? Is there
No answers yet.
Log in to leave an answer
Blogs