Skip to content

os: add func UserCacheDir() string #22536

Closed
@bradfitz

Description

@bradfitz

I've seen a dozen or so implementations of looking up the user's cache directory.

The latest is from @rsc in:

https://go-review.googlesource.com/c/go/+/68116/3/src/cmd/go/internal/cache/default.go

Which says:

// TODO(rsc): This code belongs somewhere else,
// like maybe ioutil.CacheDir or os.CacheDir.

Some examples of other implementations:
https://godoc.org/go4.org/xdgdir
https://godoc.org/camlistore.org/pkg/osutil#CacheDir
https://github.com/golang/crypto/blob/bd6f299fb381e4c3393d1c4b1f0b94f5e77650c8/acme/autocert/listener.go#L142

Consolidate into std?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions