Home > Article > Backend Development > Where is the Go Module Cache Located?
Go Module Cache Location
When working with Go modules, you may wonder where the downloaded packages are stored. After enabling modules and building a program, the necessary packages are obtained, but they're not found in $GOPATH/src/ or $GOPATH/src/mod.
Cache Location in Go 1.11
For Go version 1.11, the downloaded packages are stored in a different location:
$GOPATH/pkg/mod
This directory contains the module cache, where all downloaded packages and their dependencies are stored. When you build a Go program with modules enabled, the required packages are fetched and placed in this cache. Subsequent builds or runs of the program will use the cached packages, improving performance and reducing the need for remote package downloads.
The above is the detailed content of Where is the Go Module Cache Located?. For more information, please follow other related articles on the PHP Chinese website!