Files
trivy/pkg/cache/dir.go
2024-06-21 09:45:39 +00:00

16 lines
272 B
Go

package cache
import (
"os"
"path/filepath"
)
// DefaultDir returns/creates the cache-dir to be used for trivy operations
func DefaultDir() string {
tmpDir, err := os.UserCacheDir()
if err != nil {
tmpDir = os.TempDir()
}
return filepath.Join(tmpDir, "trivy")
}