Skip to content

Commit

Permalink
Add nolintlint linter (#229)
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.dev>
  • Loading branch information
teran authored Sep 3, 2024
1 parent 114c733 commit f6480f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ linters:
- nakedret
- nilnil
- noctx
- nolintlint
- perfsprint
- prealloc
- promlinter
Expand Down
2 changes: 1 addition & 1 deletion publisher/presenter/html/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (h *handlers) ErrorHandler(err error, c echo.Context) {
code := 500
templateFilename := serverErrorTemplateFilename

v, ok := err.(*echo.HTTPError) // nolint:errorlint
v, ok := err.(*echo.HTTPError) //nolint:errorlint
if ok {
code = v.Code
if v.Code == http.StatusNotFound {
Expand Down
8 changes: 4 additions & 4 deletions repositories/metadata/postgresql/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func mapSQLErrors(err error) error {
return metadata.ErrNotFound
}

if err, ok := err.(*pq.Error); ok { // nolint:errorlint
if err, ok := err.(*pq.Error); ok { //nolint:errorlint
if err.Code == "23505" {
return metadata.ErrConflict
}
Expand Down Expand Up @@ -92,7 +92,7 @@ func selectQuery(ctx context.Context, db queryRunner, q sq.SelectBuilder) (*sql.
return db.QueryContext(ctx, sql, args...) //nolint:sqlclosecheck
}

func insertQuery(ctx context.Context, db execRunner, q sq.InsertBuilder) (sql.Result, error) { // nolint:unparam
func insertQuery(ctx context.Context, db execRunner, q sq.InsertBuilder) (sql.Result, error) { //nolint:unparam
sql, args, err := q.ToSql()
if err != nil {
return nil, err
Expand Down Expand Up @@ -128,7 +128,7 @@ func insertQueryRow(ctx context.Context, db queryRunner, q sq.InsertBuilder) (sq
return db.QueryRowContext(ctx, sql, args...), nil
}

func updateQuery(ctx context.Context, db execRunner, q sq.UpdateBuilder) (sql.Result, error) { // nolint:unparam
func updateQuery(ctx context.Context, db execRunner, q sq.UpdateBuilder) (sql.Result, error) { //nolint:unparam
sql, args, err := q.ToSql()
if err != nil {
return nil, err
Expand All @@ -146,7 +146,7 @@ func updateQuery(ctx context.Context, db execRunner, q sq.UpdateBuilder) (sql.Re
return db.ExecContext(ctx, sql, args...)
}

func deleteQuery(ctx context.Context, db execRunner, q sq.DeleteBuilder) (sql.Result, error) { // nolint:unparam
func deleteQuery(ctx context.Context, db execRunner, q sq.DeleteBuilder) (sql.Result, error) { //nolint:unparam
sql, args, err := q.ToSql()
if err != nil {
return nil, err
Expand Down

0 comments on commit f6480f2

Please sign in to comment.