Files
trivy/utils/utils.go
Tomoya Amachi b7debf7f0a add yarn.lock parser (fanal#16)
* add yarn.lock parser

* skip analyze package files in dependency folder
2019-05-16 09:29:14 +09:00

31 lines
443 B
Go

package utils
import (
"fmt"
"os"
"path/filepath"
)
var (
NODE_DEP_DIR = "node_modules"
PathSeparator = fmt.Sprintf("%c", os.PathSeparator)
)
func CacheDir() string {
cacheDir, err := os.UserCacheDir()
if err != nil {
cacheDir = os.TempDir()
}
dir := filepath.Join(cacheDir, "fanal")
return dir
}
func StringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
}