/
githubmirror
/
trivy
Обзор
Документация
Войти
/
githubmirror
/
trivy
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
pkg/dependency/parser/java/pom/queue.go
32 строки
578 B
Teppei Fukuda
chore(deps): merge go-dep-parser into Trivy (#6094)
19 фев 2024, 14:16
Не верифицирован
19 фев 2024, 14:16
74dc5b6
Код
Авторство
О чём код?
package pom import "sync" // artifactQueue the queue of Items type artifactQueue struct { items []artifact lock sync.RWMutex } func newArtifactQueue() *artifactQueue { return &artifactQueue{} } func (s *artifactQueue) enqueue(items ...artifact) { s.lock.Lock() s.items = append(s.items, items...) s.lock.Unlock() } func (s *artifactQueue) dequeue() artifact { s.lock.Lock() item := s.items[0] s.items = s.items[1:] s.lock.Unlock() return item } // IsEmpty returns true if the queue is empty func (s *artifactQueue) IsEmpty() bool { return len(s.items) == 0 }