go: github.com/shurcooL/go/ospath Index | Files

package ospath

import "github.com/shurcooL/go/ospath"

Package ospath provides utilities to get OS-specific directories.


Package Files


func CacheDir Uses

func CacheDir(importPath string) (string, error)

CacheDir tries to acquire an OS-specific app cache directory for the given importPath. Cache directory contains the app's cached data that can be regenerated as needed. Apps should never rely on the existence of cache files.

It's guaranteed to be a unique directory for the importPath. Before returning the directory's path, CacheDir creates the directory if it doesn't already exist, so it can be used right away.

Package ospath imports 5 packages (graph) and is imported by 1 packages. Updated 2016-07-21. Refresh now. Tools for package owners.