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

Make defaultLockFile a constant

This commit is contained in:
Sascha L. Teichmann 2023-03-23 10:21:56 +01:00
parent 39787503cc
commit c3a80b9f52

View file

@ -32,10 +32,7 @@ const (
defaultWeb = "/var/www/html"
defaultDomain = "https://example.com"
defaultUpdateInterval = "on best effort"
)
var (
defaultLockFile = "/var/csaf_aggregator/run.lock"
defaultLockFile = "/var/csaf_aggregator/run.lock"
)
type provider struct {
@ -266,11 +263,11 @@ func (c *config) setDefaults() {
c.Domain = defaultDomain
}
if c.LockFile == nil {
c.LockFile = &defaultLockFile
}
if *c.LockFile == "" {
switch {
case c.LockFile == nil:
lockFile := defaultLockFile
c.LockFile = &lockFile
case *c.LockFile == "":
c.LockFile = nil
}