diff --git a/internal/lockss/load.go b/internal/lockss/load.go index 4940842..7e7503f 100644 --- a/internal/lockss/load.go +++ b/internal/lockss/load.go @@ -78,6 +78,10 @@ func (c *Config) loadFromPropsFile(filename string) (*Config, error) { if err != nil { return nil, fmt.Errorf("error occurred opening file: %w", err) } + + // #nosec G307 + // Believed to be a false-positive from recent gosec release + // https://github.com/securego/gosec/issues/714 defer func() { if err := f.Close(); err != nil { logger.Printf( @@ -287,6 +291,10 @@ func getLocalDaemonConfig(filename string, ignorePrefix string) (daemonConfig, e err, ) } + + // #nosec G307 + // Believed to be a false-positive from recent gosec release + // https://github.com/securego/gosec/issues/714 defer func() { if err := f.Close(); err != nil { // Ignore "file already closed" errors diff --git a/internal/lockss/peers.go b/internal/lockss/peers.go index 821f916..53f9d15 100644 --- a/internal/lockss/peers.go +++ b/internal/lockss/peers.go @@ -79,6 +79,9 @@ func (l IDInitialV3Peers) List() ([]V3Peer, error) { ) } + // nolint:gocritic + // refs https://github.com/atc0005/go-lockss/issues/96 + // refs https://github.com/go-critic/go-critic/issues/209 re, regExCompileErr := regexp.Compile(v3PeerRegex) if regExCompileErr != nil { return nil, fmt.Errorf("error compiling regex: %w", regExCompileErr)