mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-13 08:00:53 -08:00
15 lines
248 B
Go
15 lines
248 B
Go
package semaphore
|
|
|
|
import "golang.org/x/sync/semaphore"
|
|
|
|
const defaultSize = 5
|
|
|
|
type Weighted = semaphore.Weighted
|
|
|
|
func New(parallel int) *Weighted {
|
|
if parallel == 0 {
|
|
parallel = defaultSize
|
|
}
|
|
return semaphore.NewWeighted(int64(parallel))
|
|
}
|