mirror of
https://github.com/aquasecurity/trivy.git
synced 2026-02-06 00:33:21 +08:00
22 lines
390 B
Go
22 lines
390 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", art.Name(), art.Version)
|
||
|
|
}
|