Skip to content

proposal: cmd/go: change default $GOPATH to $XDG_CACHE_HOME/go when modules are enabled by default #26549

@nhooyr

Description

@nhooyr

At the moment, the default $GOPATH is ~/go which is fine given how $GOPATH is frequently accessed by the user because it holds the source of all their go code.

However, with vgo, it isn't necessary for a user to head into $GOPATH often because its only going to store the cache of their dependencies. Thus it shouldn't clutter their home directory. $GOPATH should instead go into $XDG_CACHE_HOME/go. $XDG_CACHE_HOME is the standard directory for user related cached data. See https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

This will ensure it doesn't clutter a user's home directory unless they want it to as $XDG_CACHE_HOME defaults to ~/.cache.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions