Skip to content

Commit

Permalink
Merge pull request #98 from atc0005/fix-linting-issues-exposed-by-lin…
Browse files Browse the repository at this point in the history
…ter-upgrades

Fix linting issues exposed by linter upgrades
  • Loading branch information
atc0005 authored Nov 9, 2021
2 parents bd66c95 + dd697e0 commit 3edbdf2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/lockss/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions internal/lockss/peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3edbdf2

Please sign in to comment.