🐹 Go (Golang)
Beginner
What is the difference between GOPATH and Go modules?
Answer
GOPATH was the original Go workspace model where all Go code had to live under a single directory tree ($GOPATH/src/github.com/user/project), making dependency management fragile and requiring all developers to use the same directory structure. Go modules (introduced in Go 1.11, default since 1.16) replaced GOPATH with a project-local go.mod file that declares the module path, Go version, and all versioned dependencies. With modules you can work in any directory, and each project has its own isolated, reproducible dependency graph locked by go.sum.