mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 06:43:05 -08:00
16 lines
272 B
Go
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")
|
|
}
|