Ignore some staticchecks in golangci-lint

This commit is contained in:
mmontes11
2025-07-08 12:32:31 +02:00
committed by Martin Montes
parent 594f7c7f37
commit abc53dc30b
2 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,14 @@ linters:
locale: US
nestif:
min-complexity: 12
staticcheck:
# TODO: fix static check issues. Contributions are welcome!
checks:
- all
- '-ST1001' # Dot imports are discouraged: https://staticcheck.dev/docs/checks/#ST1001
- '-ST1003' # Poorly chosen identifier: https://staticcheck.dev/docs/checks/#ST1003
- '-ST1005' # Incorrectly formatted error string: https://staticcheck.dev/docs/checks/#ST1005
- '-QF1008' # Omit embedded fields from selector expression: https://staticcheck.dev/docs/checks/#QF1008
exclusions:
generated: lax
presets:

View File

@ -324,7 +324,7 @@ func Connect(dsn string) (*sql.DB, error) {
if err != nil {
return nil, err
}
if err := db.Ping(); err != nil {
if err := db.PingContext(context.Background()); err != nil {
return nil, err
}
return db, nil