mirror of
https://github.com/aquasecurity/trivy.git
synced 2026-01-31 22:03:32 +08:00
22 lines
411 B
Go
22 lines
411 B
Go
package pom
|
|
|
|
import "fmt"
|
|
|
|
type pomCache map[string]*analysisResult
|
|
|
|
func newPOMCache() pomCache {
|
|
return pomCache{}
|
|
}
|
|
|
|
func (c pomCache) put(art artifact, result analysisResult) {
|
|
c[c.key(art)] = &result
|
|
}
|
|
|
|
func (c pomCache) get(art artifact) *analysisResult {
|
|
return c[c.key(art)]
|
|
}
|
|
|
|
func (c pomCache) key(art artifact) string {
|
|
return fmt.Sprintf("%s:%s:%s", art.Name(), art.Version, art.RootFilePath)
|
|
}
|