Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting issues exposed by linter upgrades #98

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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