1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Move disabling of lockfile from explicit option to empty string in lockfile

This commit is contained in:
JanHoefelmeyer 2023-03-21 08:26:51 +01:00
parent 4800f4ec12
commit f638ae9a23
3 changed files with 6 additions and 8 deletions

View file

@ -75,7 +75,6 @@ type config struct {
// LockFile tries to lock to a given file.
LockFile *string `toml:"lock_file"`
NoLock bool `toml:"no_lock"`
// Interim performs an interim scan.
Interim bool `toml:"interim"`
@ -267,12 +266,14 @@ func (c *config) setDefaults() {
c.Domain = defaultDomain
}
if c.NoLock {
c.LockFile = nil
} else if c.LockFile == nil {
if c.LockFile == nil {
c.LockFile = &defaultLockFile
}
if c.LockFile == "" {
c.LockFile = nil
}
if c.Workers <= 0 {
if n := runtime.NumCPU(); n > defaultWorkers {
c.Workers = defaultWorkers