How to properly remove packages installed via go get?
Hi everyone! I just started learning Go and encountered a confusing situation. I installed several packages via `go get`, for example:
```go
go get github.com/gin-gonic/gin
go get github.com/jinzhu/gorm
```
Now I realized I don't need GORM and want to remove it. But I can't find a `go remove` or `go uninstall` command. The documentation mentions something about `go clean`, but that's not the same thing.
In my GOPATH, I have a folder `src/github.com/jinzhu/gorm`, and I could just delete it manually. But that seems wrong — what if the package has dependencies? They would still be left hanging as dead weight.
I also tried removing the entry from `go.mod`, but after that `go build` still finds the package. My `go.mod` looks like this:
```
module myproject
go 1.21
require (
github.com/gin-go
```
No answers yet.
Log in to leave an answer