File: cache.go

package info (click to toggle)
golang-github-aquasecurity-go-dep-parser 0.0~git20220110.4a30ebc-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 19,096 kB
  • sloc: xml: 673; php: 7; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}