
glide requires gopath because it predates go 1.8 and was not updated in time to support the new module-agnostic behavior introduced in that version—despite a fix being merged, the latest stable release at the time (v0.12.3) still enforces gopath.
glide requires gopath because it predates go 1.8 and was not updated in time to support the new module-agnostic behavior introduced in that version—despite a fix being merged, the latest stable release at the time (v0.12.3) still enforces gopath.
Glide is a legacy dependency management tool for Go, developed before Go’s official module system existed. It relies heavily on Go’s traditional workspace model—where all source code, dependencies, and binaries reside under $GOPATH/src, $GOPATH/pkg, and $GOPATH/bin. Even though Go 1.8 relaxed the requirement for GOPATH in certain contexts (e.g., when using go get outside a workspace), Glide’s internal logic—especially in versions prior to v0.13—still assumes GOPATH is explicitly set to locate and manage dependencies.
For example, when you run glide up, Glide attempts to:
- Resolve imports by searching under
$GOPATH/src - Cache downloaded dependencies into
$GOPATH/src/github.com/... - Write vendor manifests relative to the workspace root
If GOPATH is unset, these operations fail with [ERROR] $GOPATH is not set.—even if your project uses vendoring and doesn’t logically depend on the GOPATH layout.
✅ Solution:
Set GOPATH explicitly (if upgrading Glide isn’t feasible):
export GOPATH="$HOME/go" export PATH="$GOPATH/bin:$PATH"
Then re-run glide up.
⚠️ Important notes:
- Glide v0.13+ (unreleased at the time of v0.12.3) includes PR #798, which adds fallback logic for unset
GOPATH, but no stable release after October 2016 included this change. - Glide is now deprecated—the Go team officially recommends migrating to Go Modules (
go mod). For new or maintained projects, replace Glide withgo mod init,go mod tidy, and vendor viago mod vendor. - If you must use Glide, verify your version:
glide --version. Consider building from source (post-PR #798) only if strictly necessary—and treat it as a temporary workaround.
In summary: Glide’s GOPATH dependency is a historical artifact—not a design choice for modern Go workflows. The path forward is clear: adopt Go Modules and retire Glide entirely.

















